[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-next RFC 4/8] x86: factor out xen variants for hypervisor setup code



On 27.09.2019 14:47, Wei Liu wrote:
> On Fri, Sep 27, 2019 at 01:39:14PM +0200, Jan Beulich wrote:
>> On 27.09.2019 13:30, Wei Liu wrote:
>>> On Wed, Sep 25, 2019 at 12:23:54PM +0200, Roger Pau Monné wrote:
>>>> Also it might be nice to introduce something like:
>>>>
>>>> enum guest_type {
>>>>     XEN_GUEST,
>>>> } guest_type;
>>>>
>>>
>>> This works for me.
>>>
>>>> So that you can add a switch here, even if the only case is Xen ATM. I
>>>> guess this will be done in a later patch, or introduce an
>>>> hypervisor_ops struct that contain pointers to functions to allow for
>>>> different implementations.
>>>>
>>>
>>> I debated this. These changes require more code churn with no apparent
>>> benefit, but if people agree this is better I can make those changes.
>>
>> Well, if the expectation is for the enum to grow (even just by one
>> further entry), then yes, I'd agree that a switch() would be nice.
> 
> Not sure if you notice comments in a later email.
> 
> Do you prefer enum+switch solution or hypervisor_op struct?

Hard to tell without knowing how many switch() there would
end up being. The more of them, the better I'd like the ops
structure variant.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.