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

[libvirt] PATCH: Fix fetch of NUMA info when building Xen capabilities



Currently if you use libvirt CVS HEAD on Xen >= 3.2 hypervisor it will fail
to open a connection. This is because I mistakenly removed the passing of
the virConnectPtr object when querying NUMA capabilities from XenD. This
patch fixes that regression

Daniel

Index: src/xen_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xen_internal.c,v
retrieving revision 1.124
diff -u -p -r1.124 xen_internal.c
--- src/xen_internal.c	20 Aug 2008 20:48:36 -0000	1.124
+++ src/xen_internal.c	28 Aug 2008 15:38:05 -0000
@@ -2159,7 +2159,8 @@ struct guest_arch {
 
 
 static virCapsPtr
-xenHypervisorBuildCapabilities(const char *hostmachine,
+xenHypervisorBuildCapabilities(virConnectPtr conn,
+                               const char *hostmachine,
                                int host_pae,
                                char *hvm_type,
                                struct guest_arch *guest_archs,
@@ -2185,7 +2186,7 @@ xenHypervisorBuildCapabilities(const cha
 
 
     if (sys_interface_version >= 4) {
-        if (xenDaemonNodeGetTopology(NULL, caps) != 0) {
+        if (xenDaemonNodeGetTopology(conn, caps) != 0) {
             virCapabilitiesFree(caps);
             return NULL;
         }
@@ -2271,7 +2272,8 @@ xenHypervisorBuildCapabilities(const cha
  * Return the capabilities of this hypervisor.
  */
 virCapsPtr
-xenHypervisorMakeCapabilitiesInternal(const char *hostmachine,
+xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
+                                      const char *hostmachine,
                                       FILE *cpuinfo, FILE *capabilities)
 {
     char line[1024], *str, *token;
@@ -2404,7 +2406,8 @@ xenHypervisorMakeCapabilitiesInternal(co
         }
     }
 
-    if ((caps = xenHypervisorBuildCapabilities(hostmachine,
+    if ((caps = xenHypervisorBuildCapabilities(conn,
+                                               hostmachine,
                                                host_pae,
                                                hvm_type,
                                                guest_archs,
@@ -2425,7 +2428,7 @@ xenHypervisorMakeCapabilitiesInternal(co
  * Return the capabilities of this hypervisor.
  */
 virCapsPtr
-xenHypervisorMakeCapabilities(void)
+xenHypervisorMakeCapabilities(virConnectPtr conn)
 {
     virCapsPtr caps;
     FILE *cpuinfo, *capabilities;
@@ -2451,7 +2454,10 @@ xenHypervisorMakeCapabilities(void)
         }
     }
 
-    caps = xenHypervisorMakeCapabilitiesInternal(utsname.machine, cpuinfo, capabilities);
+    caps = xenHypervisorMakeCapabilitiesInternal(conn,
+                                                 utsname.machine,
+                                                 cpuinfo,
+                                                 capabilities);
 
     if (cpuinfo)
         fclose(cpuinfo);
Index: src/xen_internal.h
===================================================================
RCS file: /data/cvs/libvirt/src/xen_internal.h,v
retrieving revision 1.29
diff -u -p -r1.29 xen_internal.h
--- src/xen_internal.h	20 Aug 2008 20:48:36 -0000	1.29
+++ src/xen_internal.h	28 Aug 2008 15:38:05 -0000
@@ -17,7 +17,7 @@
 extern struct xenUnifiedDriver xenHypervisorDriver;
 int	xenHypervisorInit		(void);
 
-virCapsPtr xenHypervisorMakeCapabilities (void);
+virCapsPtr xenHypervisorMakeCapabilities (virConnectPtr conn);
 
 /* The following calls are made directly by the Xen proxy: */
 
@@ -38,7 +38,8 @@ int	xenHypervisorClose		(virConnectPtr c
 int	xenHypervisorGetVersion		(virConnectPtr conn,
                                          unsigned long *hvVer);
 virCapsPtr
-        xenHypervisorMakeCapabilitiesInternal(const char *hostmachine,
+        xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
+                                              const char *hostmachine,
                                               FILE *cpuinfo,
                                               FILE *capabilities);
 char *
Index: src/xen_unified.c
===================================================================
RCS file: /data/cvs/libvirt/src/xen_unified.c,v
retrieving revision 1.53
diff -u -p -r1.53 xen_unified.c
--- src/xen_unified.c	20 Aug 2008 20:48:36 -0000	1.53
+++ src/xen_unified.c	28 Aug 2008 15:38:05 -0000
@@ -333,7 +333,7 @@ xenUnifiedOpen (virConnectPtr conn, xmlU
         }
     }
 
-    if (!(priv->caps = xenHypervisorMakeCapabilities())) {
+    if (!(priv->caps = xenHypervisorMakeCapabilities(conn))) {
         DEBUG0("Failed to make capabilities");
         goto fail;
     }
Index: tests/xencapstest.c
===================================================================
RCS file: /data/cvs/libvirt/tests/xencapstest.c,v
retrieving revision 1.14
diff -u -p -r1.14 xencapstest.c
--- tests/xencapstest.c	25 Jul 2008 13:17:27 -0000	1.14
+++ tests/xencapstest.c	28 Aug 2008 15:38:05 -0000
@@ -49,7 +49,7 @@ static int testCompareFiles(const char *
   if (!(fp2 = fopen(capabilities, "r")))
       goto fail;
 
-  if (!(caps = xenHypervisorMakeCapabilitiesInternal(hostmachine, fp1, fp2)))
+  if (!(caps = xenHypervisorMakeCapabilitiesInternal(NULL, hostmachine, fp1, fp2)))
       goto fail;
 
   if (!(actualxml = virCapabilitiesFormatXML(caps)))

-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


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