]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Support Xen 4.0 sysctl version 7
authorJim Fehlig <jfehlig@novell.com>
Wed, 27 Jan 2010 17:56:18 +0000 (10:56 -0700)
committerJim Fehlig <jfehlig@novell.com>
Wed, 27 Jan 2010 17:56:18 +0000 (10:56 -0700)
xen-unstable c/s 20762 bumped XEN_SYSCTL_INTERFACE_VERSION to 7.  The
interface change does not affect libvirt, other than xenHypervisorInit()
failing since version 7 is not tried.

The attached patch accommodates the upcoming Xen 4.0 release by checking
for XEN_SYSCTL_INTERFACE_VERSION 7.  If found, it sets
XEN_DOMCTL_INTERFACE_VERSION to 6, which is also new to Xen 4.0.

src/xen/xen_hypervisor.c

index 6d8acccf72fa63e9e7f4fa405dda3b2c0d7f559e..7f3909511ce52d988e549dcf9ec19190c5a9ab9f 100644 (file)
@@ -2100,12 +2100,14 @@ xenHypervisorInit(void)
             DEBUG0("Using hypervisor call v2, sys ver6 dom ver5\n");
             goto done;
         }
-        /* Xen 4.0 */
+    }
+
+    /* Xen 4.0 */
+    sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
+    if (virXen_getdomaininfo(fd, 0, &info) == 1) {
         dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */
-        if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
-            DEBUG0("Using hypervisor call v2, sys ver6 dom ver6\n");
-            goto done;
-        }
+        DEBUG0("Using hypervisor call v2, sys ver7 dom ver6\n");
+        goto done;
     }
 
     hypervisor_version = 1;