]> xenbits.xensource.com Git - libvirt.git/commitdiff
Make LXC / UML drivers robust against NUMA topology brokenness
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 13 Aug 2009 10:56:31 +0000 (11:56 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 13 Aug 2009 11:11:41 +0000 (12:11 +0100)
Some kernel versions expose broken NUMA topology for some machines.
This causes the LXC/UML drivers to fail to start. QEMU driver was
already fixed for this problem

* src/lxc_conf.c: Log and ignore failure to populate NUMA info
* src/uml_conf.c: Log and ignore failure to populate NUMA info
* src/capabilities.c: Reset nnumaCell to 0 after freeing

src/capabilities.c
src/lxc_conf.c
src/uml_conf.c

index c6766b6d7b161465f8e32954eb5eb8d7f819fd46..193a9fe97324c0211857361d180651fdedc14a74 100644 (file)
@@ -139,6 +139,7 @@ virCapabilitiesFreeNUMAInfo(virCapsPtr caps)
     for (i = 0 ; i < caps->host.nnumaCell ; i++)
         virCapabilitiesFreeHostNUMACell(caps->host.numaCell[i]);
     VIR_FREE(caps->host.numaCell);
+    caps->host.nnumaCell = 0;
 }
 
 /**
index d06a02441ab258c54b121277bca92bf4629c7940..fef60baae7779ea4f830b90bd674bca2e089378e 100644 (file)
@@ -30,6 +30,8 @@
 #include "lxc_conf.h"
 #include "nodeinfo.h"
 #include "virterror_internal.h"
+#include "logging.h"
+
 
 #define VIR_FROM_THIS VIR_FROM_LXC
 
@@ -46,8 +48,14 @@ virCapsPtr lxcCapsInit(void)
                                    0, 0)) == NULL)
         goto no_memory;
 
-    if (nodeCapsInitNUMA(caps) < 0)
-        goto no_memory;
+    /* Some machines have problematic NUMA toplogy causing
+     * unexpected failures. We don't want to break the QEMU
+     * driver in this scenario, so log errors & carry on
+     */
+    if (nodeCapsInitNUMA(caps) < 0) {
+        virCapabilitiesFreeNUMAInfo(caps);
+        VIR_WARN0("Failed to query host NUMA topology, disabling NUMA capabilities");
+    }
 
     /* XXX shouldn't 'borrow' KVM's prefix */
     virCapabilitiesSetMacPrefix(caps, (unsigned char []){ 0x52, 0x54, 0x00 });
index 48e05a8a2b4af973c8e1a2ca6033f89e88c68e1c..4f756d4a7d80ef3788a351f6362837c9ff2e83e3 100644 (file)
@@ -45,6 +45,7 @@
 #include "nodeinfo.h"
 #include "verify.h"
 #include "bridge.h"
+#include "logging.h"
 
 #define VIR_FROM_THIS VIR_FROM_UML
 
@@ -63,8 +64,14 @@ virCapsPtr umlCapsInit(void) {
                                    0, 0)) == NULL)
         goto no_memory;
 
-    if (nodeCapsInitNUMA(caps) < 0)
-        goto no_memory;
+    /* Some machines have problematic NUMA toplogy causing
+     * unexpected failures. We don't want to break the QEMU
+     * driver in this scenario, so log errors & carry on
+     */
+    if (nodeCapsInitNUMA(caps) < 0) {
+        virCapabilitiesFreeNUMAInfo(caps);
+        VIR_WARN0("Failed to query host NUMA topology, disabling NUMA capabilities");
+    }
 
     if ((guest = virCapabilitiesAddGuest(caps,
                                          "uml",