[libvirt] [PATCH] Add virConnectGetLibvirtVersion API

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

 



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
detection/enabling/disabling.

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.

Thanks,
Cole
commit 59871ddf8956a96a1148769c05ada6e763d91080
Author: Cole Robinson <crobinso@xxxxxxxxxx>
Date:   Mon Nov 2 15:34:46 2009 -0500

    Add virConnectGetLibvirtVersion
    
    There is currently no way to determine the libvirt version of a remote libvirtd we
    are connected to. This is a useful piece of data to enable feature detection.

diff --git a/daemon/remote.c b/daemon/remote.c
index 4296fc3..618954c 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -259,6 +259,26 @@ remoteDispatchGetVersion (struct qemud_server *server ATTRIBUTE_UNUSED,
 }
 
 static int
+remoteDispatchGetLibvirtVersion (struct qemud_server *server ATTRIBUTE_UNUSED,
+                                 struct qemud_client *client ATTRIBUTE_UNUSED,
+                                 virConnectPtr conn,
+                                 remote_message_header *hdr ATTRIBUTE_UNUSED,
+                                 remote_error *rerr,
+                                 void *args ATTRIBUTE_UNUSED,
+                                 remote_get_libvirt_version_ret *ret)
+{
+    unsigned long libVer;
+
+    if (virConnectGetLibvirtVersion (conn, &libVer) == -1) {
+        remoteDispatchConnError(rerr, conn);
+        return -1;
+    }
+
+    ret->lib_ver = libVer;
+    return 0;
+}
+
+static int
 remoteDispatchGetHostname (struct qemud_server *server ATTRIBUTE_UNUSED,
                            struct qemud_client *client ATTRIBUTE_UNUSED,
                            virConnectPtr conn,
diff --git a/daemon/remote_dispatch_prototypes.h b/daemon/remote_dispatch_prototypes.h
index 9afd2c7..85884b4 100644
--- a/daemon/remote_dispatch_prototypes.h
+++ b/daemon/remote_dispatch_prototypes.h
@@ -450,6 +450,14 @@ static int remoteDispatchGetHostname(
     remote_error *err,
     void *args,
     remote_get_hostname_ret *ret);
+static int remoteDispatchGetLibvirtVersion(
+    struct qemud_server *server,
+    struct qemud_client *client,
+    virConnectPtr conn,
+    remote_message_header *hdr,
+    remote_error *err,
+    void *args,
+    remote_get_libvirt_version_ret *ret);
 static int remoteDispatchGetMaxVcpus(
     struct qemud_server *server,
     struct qemud_client *client,
diff --git a/daemon/remote_dispatch_ret.h b/daemon/remote_dispatch_ret.h
index 6ced13a..020337e 100644
--- a/daemon/remote_dispatch_ret.h
+++ b/daemon/remote_dispatch_ret.h
@@ -106,3 +106,4 @@
     remote_secret_get_xml_desc_ret val_remote_secret_get_xml_desc_ret;
     remote_secret_get_value_ret val_remote_secret_get_value_ret;
     remote_secret_lookup_by_usage_ret val_remote_secret_lookup_by_usage_ret;
+    remote_get_libvirt_version_ret val_remote_get_libvirt_version_ret;
diff --git a/daemon/remote_dispatch_table.h b/daemon/remote_dispatch_table.h
index bb13f4c..c6db600 100644
--- a/daemon/remote_dispatch_table.h
+++ b/daemon/remote_dispatch_table.h
@@ -747,3 +747,8 @@
     .args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_tunnel_args,
     .ret_filter = (xdrproc_t) xdr_void,
 },
+{   /* GetLibvirtVersion => 149 */
+    .fn = (dispatch_fn) remoteDispatchGetLibvirtVersion,
+    .args_filter = (xdrproc_t) xdr_void,
+    .ret_filter = (xdrproc_t) xdr_remote_get_libvirt_version_ret,
+},
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 6186d4e..9644538 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -489,6 +489,8 @@ int                     virConnectClose         (virConnectPtr conn);
 const char *            virConnectGetType       (virConnectPtr conn);
 int                     virConnectGetVersion    (virConnectPtr conn,
                                                  unsigned long *hvVer);
+int                     virConnectGetLibvirtVersion (virConnectPtr conn,
+                                                     unsigned long *libVer);
 char *                  virConnectGetHostname   (virConnectPtr conn);
 char *                  virConnectGetURI        (virConnectPtr conn);
 
diff --git a/python/generator.py b/python/generator.py
index 21b4137..0c41f27 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -255,6 +255,7 @@ foreign_encoding_args = (
 # Class methods which are written by hand in libvir.c but the Python-level
 # code is still automatically generated (so they are not in skip_function()).
 skip_impl = (
+    'virConnectGetLibvirtVersion',
     'virConnectListDomainsID',
     'virConnectListDefinedDomains',
     'virConnectListNetworks',
diff --git a/python/libvirt-override-api.xml b/python/libvirt-override-api.xml
index 148b89b..be3fffa 100644
--- a/python/libvirt-override-api.xml
+++ b/python/libvirt-override-api.xml
@@ -1,6 +1,11 @@
 <?xml version="1.0"?>
 <api name='libvir-python'>
   <symbols>
+    <function name="virConnectGetLibvirtVersion" file='python'>
+      <info>Returns the libvirt version of the connection host</info>
+      <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
+      <return type='int' info="0 on success, -1 on error"/>
+    </function>
     <function name="virConnectListDomainsID" file='python'>
       <info>Returns the list of the ID of the domains on the hypervisor</info>
       <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 5d24fd2..4cee4b3 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -728,6 +728,31 @@ libvirt_virGetVersion (PyObject *self ATTRIBUTE_UNUSED, PyObject *args)
         return Py_BuildValue ((char *) "kk", libVer, typeVer);
 }
 
+static PyObject *
+libvirt_virConnectGetLibvirtVersion (PyObject *self ATTRIBUTE_UNUSED,
+                                     PyObject *args)
+{
+    unsigned long libVer;
+    int c_retval;
+    virConnectPtr conn;
+    PyObject *pyobj_conn;
+
+    if (!PyArg_ParseTuple(args, (char *)"O:virConnectGetLibvirtVersion",
+                          &pyobj_conn))
+        return(NULL);
+    conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+    LIBVIRT_BEGIN_ALLOW_THREADS;
+
+    c_retval = virConnectGetLibvirtVersion(conn, &libVer);
+
+    LIBVIRT_END_ALLOW_THREADS;
+
+    if (c_retval == -1)
+        return VIR_PY_NONE;
+
+    return PyInt_FromLong (libVer);
+}
 
 static PyObject *
 libvirt_virConnectListDomainsID(PyObject *self ATTRIBUTE_UNUSED,
@@ -2392,6 +2417,7 @@ libvirt_virEventInvokeTimeoutCallback(PyObject *self ATTRIBUTE_UNUSED,
 static PyMethodDef libvirtMethods[] = {
 #include "libvirt-export.c"
     {(char *) "virGetVersion", libvirt_virGetVersion, METH_VARARGS, NULL},
+    {(char *) "virConnectGetLibvirtVersion", libvirt_virConnectGetLibvirtVersion, METH_VARARGS, NULL},
     {(char *) "virConnectOpenAuth", libvirt_virConnectOpenAuth, METH_VARARGS, NULL},
     {(char *) "virConnectListDomainsID", libvirt_virConnectListDomainsID, METH_VARARGS, NULL},
     {(char *) "virConnectListDefinedDomains", libvirt_virConnectListDefinedDomains, METH_VARARGS, NULL},
diff --git a/src/driver.h b/src/driver.h
index 0c8f923..99d63c1 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -71,6 +71,9 @@ typedef const char *
 typedef int
         (*virDrvGetVersion)		(virConnectPtr conn,
                                          unsigned long *hvVer);
+typedef int
+        (*virDrvGetLibvirtVersion)      (virConnectPtr conn,
+                                         unsigned long *libVer);
 typedef char *
     (*virDrvGetHostname)    (virConnectPtr conn);
 typedef char *
@@ -357,6 +360,7 @@ struct _virDriver {
     virDrvDrvSupportsFeature   supports_feature;
     virDrvGetType			type;
     virDrvGetVersion		version;
+    virDrvGetLibvirtVersion		libvirtVersion;
     virDrvGetHostname       getHostname;
     virDrvGetMaxVcpus		getMaxVcpus;
     virDrvNodeGetInfo		nodeGetInfo;
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index e063b46..4831be6 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -3214,6 +3214,7 @@ static virDriver esxDriver = {
     esxSupportsFeature,              /* supports_feature */
     esxGetType,                      /* type */
     esxGetVersion,                   /* version */
+    NULL,                            /* libvirtVersion (should be skipped) */
     esxGetHostname,                  /* hostname */
     NULL,                            /* getMaxVcpus */
     esxNodeGetInfo,                  /* nodeGetInfo */
diff --git a/src/libvirt.c b/src/libvirt.c
index 5ddf27a..85d7008 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1437,6 +1437,48 @@ error:
 }
 
 /**
+ * virConnectGetLibvirtVersion:
+ * @conn: pointer to the hypervisor connection
+ * @libVer: returns the libvirt library version used on the connection (OUT)
+ *
+ * Provides @libVer, which is the version of the libvirt on the @conn host.
+ *
+ * Returns -1 in case of failure, 0 otherwise, and values for @libVer have
+ *      the format major * 1,000,000 + minor * 1,000 + release.
+ */
+int
+virConnectGetLibvirtVersion(virConnectPtr conn, unsigned long *libVer)
+{
+    DEBUG("conn=%p, libVir=%p", conn, libVer);
+
+    virResetLastError();
+
+    if (!VIR_IS_CONNECT(conn)) {
+        virLibConnError(NULL, VIR_ERR_INVALID_CONN, __FUNCTION__);
+        return -1;
+    }
+
+    if (libVer == NULL) {
+        virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
+        goto error;
+    }
+
+    if (conn->driver->libvirtVersion) {
+        int ret = conn->driver->libvirtVersion(conn, libVer);
+        if (ret < 0)
+            goto error;
+        return ret;
+    }
+
+    virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+
+error:
+    /* Copy to connection error object for back compatability */
+    virSetConnError(conn);
+    return -1;
+}
+
+/**
  * virConnectGetHostname:
  * @conn: pointer to a hypervisor connection
  *
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 15d75fd..3967cb4 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -464,6 +464,7 @@ virExecDaemonize;
 virSetCloseExec;
 virSetNonBlock;
 virFormatMacAddr;
+virGetLibvirtVersion;
 virGetHostname;
 virParseMacAddr;
 virFileDeletePid;
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 8921c1a..b8723c2 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -327,6 +327,7 @@ LIBVIRT_0.7.2 {
 	virStreamAbort;
 	virStreamFree;
 	virDomainMigrateToURI;
+	virConnectGetLibvirtVersion;
 } LIBVIRT_0.7.1;
 
 # .... define new API here using predicted next version number ....
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 05fc48d..b9e181d 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -2244,6 +2244,7 @@ static virDriver lxcDriver = {
     NULL, /* supports_feature */
     NULL, /* type */
     lxcVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     virGetHostname, /* getHostname */
     NULL, /* getMaxVcpus */
     nodeGetInfo, /* nodeGetInfo */
diff --git a/src/opennebula/one_driver.c b/src/opennebula/one_driver.c
index cffd626..f62e0a7 100644
--- a/src/opennebula/one_driver.c
+++ b/src/opennebula/one_driver.c
@@ -697,6 +697,7 @@ static virDriver oneDriver = {
     NULL, /* supports_feature */
     NULL, /* type */
     oneVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     NULL, /* getHostname */
     NULL, /* getMaxVcpus */
     NULL, /* nodeGetInfo */
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 53fcaee..6cb8a0b 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -1405,6 +1405,7 @@ static virDriver openvzDriver = {
     NULL, /* supports_feature */
     openvzGetType, /* type */
     openvzGetVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     NULL, /* getHostname */
     openvzGetMaxVCPUs, /* getMaxVcpus */
     nodeGetInfo, /* nodeGetInfo */
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index ef465ed..558e8fa 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -1317,6 +1317,7 @@ virDriver phypDriver = {
     NULL,                       /* supports_feature */
     NULL,                       /* type */
     NULL,                       /* version */
+    virGetLibvirtVersion,       /* libvirtVersion */
     NULL,                       /* getHostname */
     NULL,                       /* getMaxVcpus */
     NULL,                       /* nodeGetInfo */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6981d99..e4d9ea7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6999,6 +6999,7 @@ static virDriver qemuDriver = {
     qemudSupportsFeature, /* supports_feature */
     qemudGetType, /* type */
     qemudGetVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     virGetHostname, /* getHostname */
     qemudGetMaxVCPUs, /* getMaxVcpus */
     nodeGetInfo, /* nodeGetInfo */
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index a198999..f390a07 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1539,6 +1539,30 @@ done:
     return rv;
 }
 
+static int
+remoteGetLibvirtVersion (virConnectPtr conn, unsigned long *libVer)
+{
+    int rv = -1;
+    remote_get_libvirt_version_ret ret;
+    struct private_data *priv = conn->privateData;
+
+    remoteDriverLock(priv);
+
+    memset (&ret, 0, sizeof ret);
+    if (call (conn, priv, 0, REMOTE_PROC_GET_LIBVIRT_VERSION,
+              (xdrproc_t) xdr_void, (char *) NULL,
+              (xdrproc_t) xdr_remote_get_libvirt_version_ret,
+              (char *) &ret) == -1)
+        goto done;
+
+    if (libVer) *libVer = ret.lib_ver;
+    rv = 0;
+
+done:
+    remoteDriverUnlock(priv);
+    return rv;
+}
+
 static char *
 remoteGetHostname (virConnectPtr conn)
 {
@@ -8388,6 +8412,7 @@ static virDriver remote_driver = {
     remoteSupportsFeature, /* supports_feature */
     remoteType, /* type */
     remoteGetVersion, /* version */
+    remoteGetLibvirtVersion, /* libvirtVersion */
     remoteGetHostname, /* getHostname */
     remoteGetMaxVcpus, /* getMaxVcpus */
     remoteNodeGetInfo, /* nodeGetInfo */
diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c
index 1449ed4..a5794cc 100644
--- a/src/remote/remote_protocol.c
+++ b/src/remote/remote_protocol.c
@@ -4,7 +4,7 @@
  * It was generated using rpcgen.
  */
 
-#include "remote_protocol.h"
+#include "./remote/remote_protocol.h"
 #include "internal.h"
 #include <arpa/inet.h>
 
@@ -309,6 +309,15 @@ xdr_remote_get_version_ret (XDR *xdrs, remote_get_version_ret *objp)
 }
 
 bool_t
+xdr_remote_get_libvirt_version_ret (XDR *xdrs, remote_get_libvirt_version_ret *objp)
+{
+
+         if (!xdr_int64_t (xdrs, &objp->lib_ver))
+                 return FALSE;
+        return TRUE;
+}
+
+bool_t
 xdr_remote_get_hostname_ret (XDR *xdrs, remote_get_hostname_ret *objp)
 {
 
diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h
index d87e8bc..d90444b 100644
--- a/src/remote/remote_protocol.h
+++ b/src/remote/remote_protocol.h
@@ -179,6 +179,11 @@ struct remote_get_version_ret {
 };
 typedef struct remote_get_version_ret remote_get_version_ret;
 
+struct remote_get_libvirt_version_ret {
+        int64_t lib_ver;
+};
+typedef struct remote_get_libvirt_version_ret remote_get_libvirt_version_ret;
+
 struct remote_get_hostname_ret {
         remote_nonnull_string hostname;
 };
@@ -1536,7 +1541,6 @@ struct remote_domain_migrate_prepare_tunnel_args {
         remote_nonnull_string dom_xml;
 };
 typedef struct remote_domain_migrate_prepare_tunnel_args remote_domain_migrate_prepare_tunnel_args;
-
 #define REMOTE_PROGRAM 0x20008086
 #define REMOTE_PROTOCOL_VERSION 1
 
@@ -1689,6 +1693,7 @@ enum remote_procedure {
         REMOTE_PROC_SECRET_UNDEFINE = 146,
         REMOTE_PROC_SECRET_LOOKUP_BY_USAGE = 147,
         REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL = 148,
+        REMOTE_PROC_GET_LIBVIRT_VERSION = 149,
 };
 typedef enum remote_procedure remote_procedure;
 
@@ -1746,6 +1751,7 @@ extern  bool_t xdr_remote_supports_feature_args (XDR *, remote_supports_feature_
 extern  bool_t xdr_remote_supports_feature_ret (XDR *, remote_supports_feature_ret*);
 extern  bool_t xdr_remote_get_type_ret (XDR *, remote_get_type_ret*);
 extern  bool_t xdr_remote_get_version_ret (XDR *, remote_get_version_ret*);
+extern  bool_t xdr_remote_get_libvirt_version_ret (XDR *, remote_get_libvirt_version_ret*);
 extern  bool_t xdr_remote_get_hostname_ret (XDR *, remote_get_hostname_ret*);
 extern  bool_t xdr_remote_get_uri_ret (XDR *, remote_get_uri_ret*);
 extern  bool_t xdr_remote_get_max_vcpus_args (XDR *, remote_get_max_vcpus_args*);
@@ -2001,6 +2007,7 @@ extern bool_t xdr_remote_supports_feature_args ();
 extern bool_t xdr_remote_supports_feature_ret ();
 extern bool_t xdr_remote_get_type_ret ();
 extern bool_t xdr_remote_get_version_ret ();
+extern bool_t xdr_remote_get_libvirt_version_ret ();
 extern bool_t xdr_remote_get_hostname_ret ();
 extern bool_t xdr_remote_get_uri_ret ();
 extern bool_t xdr_remote_get_max_vcpus_args ();
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 2b3c03b..ab8002b 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -302,6 +302,10 @@ struct remote_get_version_ret {
     hyper hv_ver;
 };
 
+struct remote_get_libvirt_version_ret {
+    hyper lib_ver;
+};
+
 struct remote_get_hostname_ret {
     remote_nonnull_string hostname;
 };
@@ -1532,7 +1536,9 @@ enum remote_procedure {
     REMOTE_PROC_SECRET_UNDEFINE = 146,
     REMOTE_PROC_SECRET_LOOKUP_BY_USAGE = 147,
 
-    REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL = 148
+    REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL = 148,
+
+    REMOTE_PROC_GET_LIBVIRT_VERSION = 149
 };
 
 
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 31b5ad3..29051a4 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -4660,6 +4660,7 @@ static virDriver testDriver = {
     NULL, /* supports_feature */
     NULL, /* type */
     testGetVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     virGetHostname, /* getHostname */
     testGetMaxVCPUs, /* getMaxVcpus */
     testNodeGetInfo, /* nodeGetInfo */
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 2455b92..47c4dc3 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1775,6 +1775,7 @@ static virDriver umlDriver = {
     NULL, /* supports_feature */
     umlGetType, /* type */
     umlGetVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     virGetHostname, /* getHostname */
     NULL, /* getMaxVcpus */
     nodeGetInfo, /* nodeGetInfo */
diff --git a/src/util/util.c b/src/util/util.c
index 853d3a0..e03a64e 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -1801,6 +1801,14 @@ int virDiskNameToIndex(const char *name) {
     return idx;
 }
 
+int virGetLibvirtVersion(virConnectPtr conn ATTRIBUTE_UNUSED,
+                         unsigned long *lib_ver)
+{
+    *lib_ver = LIBVIR_VERSION_NUMBER;
+
+    return 0;
+}
+
 #ifndef AI_CANONIDN
 #define AI_CANONIDN 0
 #endif
diff --git a/src/util/util.h b/src/util/util.h
index f4e395e..d87d4bd 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -222,6 +222,8 @@ static inline int getuid (void) { return 0; }
 static inline int getgid (void) { return 0; }
 #endif
 
+int virGetLibvirtVersion(virConnectPtr conn, unsigned long *lib_ver);
+
 char *virGetHostname(virConnectPtr conn);
 
 int virKillProcess(pid_t pid, int sig);
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index c6305ac..3cd38f4 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -6388,6 +6388,7 @@ virDriver NAME(Driver) = {
     NULL, /* supports_feature */
     NULL, /* type */
     vboxGetVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     virGetHostname, /* getHostname */
     vboxGetMaxVcpus, /* getMaxVcpus */
     nodeGetInfo, /* nodeGetInfo */
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 6dc4ac0..3e09693 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -1641,6 +1641,7 @@ static virDriver xenUnifiedDriver = {
     xenUnifiedSupportsFeature, /* supports_feature */
     xenUnifiedType, /* type */
     xenUnifiedGetVersion, /* version */
+    virGetLibvirtVersion, /* libvirtVersion */
     virGetHostname, /* getHostname */
     xenUnifiedGetMaxVcpus, /* getMaxVcpus */
     xenUnifiedNodeGetInfo, /* nodeGetInfo */
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]