On 2017年07月05日 19:19, Wei Liu wrote:
> On Wed, Jul 05, 2017 at 06:53:31PM +0800, Lan Tianyu wrote:
>> On 2017年07月04日 19:03, Wei Liu wrote:
>>> On Tue, Jul 04, 2017 at 11:46:18AM +0100, Julien Grall wrote:
>>>> Hi,
>>>>
>>>> On 06/29/2017 06:50 AM, Lan Tianyu wrote:
>>>>> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
>>>>> index bffbc45..55119e2 100644
>>>>> --- a/tools/libxl/libxl_create.c
>>>>> +++ b/tools/libxl/libxl_create.c
>>>>> @@ -557,6 +557,12 @@ int libxl__domain_make(libxl__gc *gc, 
>>>>> libxl_domain_config *d_config,
>>>>>           }
>>>>>       }
>>>>> +    rc = libxl__arch_create_viommu(gc, d_config, *domid);
>>>>> +    if (rc < 0) {
>>>>> +        LOGED(ERROR, *domid, "create vIOMMU fail");
>>>>> +        goto out;
>>>>> +    }
>>>>> +
>>>>
>>>> Rather than creating yet another arch helper, would not it be better to 
>>>> have
>>>> a "post domain creation helper" that will do anything arch specific related
>>>> (i.e creating vIOMMU, save config...)?
>>>>
>>>
>>> Yes if this can be done this is preferable -- I'm not yet sure if the
>>> creation of viommu needs to be done at a particular point.
>>>
>>
>> Hi Wei & Julien:
>> I am not sure the meaning of "post domain creation helper" here.
>> Could you elaborate it? Thanks. We can add a new function and do arch
>> specific operation for vIOMMU and use vIOMMU type to identify different
>> arch.
>>
>> So far, creation of viommu doesn't require at particular point. Thanks.
>>
> 
> There are already a lot of hooks in libxl, see libxl_arch.h.
> 
> What Julien meant was you don't necessarily need to introduce
> libxl__arch_create_viommu when you can put the code into one of the
> existing hooks.
> 
> Given the code needed is simply calling an xc function, I think it can
> be put into one of those hooks.
> 

OK. I got it. How about putting new code in libxl__arch_domain_create()?


-- 
Best regards
Tianyu Lan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to