[libvirt PATCH] remote: fix driver name check for libxl driver

Jim Fehlig jfehlig at suse.com
Mon May 4 18:10:02 UTC 2020


On 5/4/20 11:43 AM, Daniel P. Berrangé wrote:
> On Mon, May 04, 2020 at 11:33:46AM -0600, Jim Fehlig wrote:
>> On 5/4/20 10:48 AM, Daniel P. Berrangé wrote:
>>> The virConnectGetType() returns "xenlight" for libxl, not "LIBXL".
>>
>> The libxl driver implements connectGetType, where it returns "Xen"
>>
>> https://gitlab.com/libvirt/libvirt/-/blob/master/src/libxl/libxl_driver.c#L909
>>
>> Is the driver function table not initialized, in which case
>> virConnectGetType returns the driver's name? Either way, I'm really
>> lamenting my choice of names and inconsistent use of them in the libxl
>> driver :-(. But I don't think it is possible to change the type returned
>> through virConnectGetType, as that could break existing users.
> 
> Doh, I missed that. So we have virHypervisorDriver using "xenlight",
> and virStateDriver using  "LIBXL" and virConnectGetType using "Xen".
> 
> Can we changes the driver tables to use "Xen" too, now that we got
> rid of the old Xen driver. I can't remember if the driver tables
> names leak out anywhere important ?

It doesn't appear to be the case, but I only looked quickly and could have 
missed something.

I'll send a patch to change 'name' in the driver tables. With the old Xen driver 
gone Andrea and I also discussed renaming the libxl driver to xen, but I'm not 
sure it is worth the effort. It seems difficult to remove all references to 
libxl. E.g. changing the '--with-libxl' configure option would break external 
users/scripts.

Regards,
Jim





More information about the libvir-list mailing list