[libvirt] [PATCH] Add virConnectGetLibvirtVersion API

Cole Robinson crobinso at redhat.com
Mon Nov 2 20:52:28 UTC 2009

Hi all,

The attached patch adds a new API call for retrieving the libvirt
version used by a connection: virConnectGetLibvirtVersion. Without this,
there is currently no way to determine the libvirt version of a remote
qemu connection for example. This info can be useful for feature

As an example, virt-install may want to use the AC97 sound device as
the default sound model for new VMs. However, this was only added to
libvirt's white list in 0.6.0, while the other models have been
available since 0.4.3. If installing a remote guest, virt-install will
want to ensure that the remote libvirtd is >= 0.6.0. Granted, the remote
version could have backported the AC97 patch and virt-install would be
incorrect, but better to be overly restrictive than to blindly specify
AC97 and have guest creation bomb out.

The 'correct' way to handle the above issue would be some combination of
dropping internal whitelists from libvirt and generating them from info
reported by the hypervisor, and advertising the available values in the
capabilities XML. However I think this API addition makes things more
manageable with little downside until a proper solution is implemented.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-virConnectGetLibvirtVersion.patch
Type: text/x-patch
Size: 20416 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20091102/a53c833d/attachment-0001.bin>

More information about the libvir-list mailing list