]> xenbits.xensource.com Git - libvirt.git/commitdiff
virnuma: use virNumaNodesetIsAvailable checking nodeset in virNumaSetupMemoryPolicy
authorChen Fan <chen.fan.fnst@cn.fujitsu.com>
Tue, 4 Nov 2014 02:44:41 +0000 (10:44 +0800)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 4 Nov 2014 06:03:36 +0000 (07:03 +0100)
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
src/util/virnuma.c

index 2540bd256fde2355e153727044239b6ff1e8dad1..89435de6077e69125404abe8454a473dc7313f22 100644 (file)
@@ -98,16 +98,13 @@ virNumaSetupMemoryPolicy(virDomainNumatunePtr numatune,
     int maxnode = 0;
     virBitmapPtr tmp_nodemask = NULL;
 
+    if (!virNumaNodesetIsAvailable(numatune))
+        return -1;
+
     tmp_nodemask = virDomainNumatuneGetNodeset(numatune, nodemask, -1);
     if (!tmp_nodemask)
         return 0;
 
-    if (numa_available() < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       "%s", _("Host kernel is not aware of NUMA."));
-        return -1;
-    }
-
     maxnode = numa_max_node();
     maxnode = maxnode < NUMA_NUM_NODES ? maxnode : NUMA_NUM_NODES;
 
@@ -347,12 +344,8 @@ int
 virNumaSetupMemoryPolicy(virDomainNumatunePtr numatune,
                          virBitmapPtr nodemask ATTRIBUTE_UNUSED)
 {
-    if (virDomainNumatuneGetNodeset(numatune, NULL, -1)) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("libvirt is compiled without NUMA tuning support"));
-
+    if (!virNumaNodesetIsAvailable(numatune))
         return -1;
-    }
 
     return 0;
 }