]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: disallow empty cpuset for emulatorpin
authorPeter Krempa <pkrempa@redhat.com>
Wed, 6 Jan 2016 15:07:42 +0000 (16:07 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Jan 2016 16:27:54 +0000 (17:27 +0100)
It's disallowed in the API.

src/conf/domain_conf.c

index 68287f3d7d4db44442ff06a1e64a1f5fa32bb4aa..1ea74a6ad6df3fb1ba55445bf77f0d02e1210aba 100644 (file)
@@ -14275,8 +14275,18 @@ virDomainEmulatorPinDefParseXML(xmlNodePtr node)
         return NULL;
     }
 
-    ignore_value(virBitmapParse(tmp, 0, &def, VIR_DOMAIN_CPUMASK_LEN));
+    if (virBitmapParse(tmp, 0, &def, VIR_DOMAIN_CPUMASK_LEN) < 0)
+        goto cleanup;
+
+    if (virBitmapIsAllClear(def)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("Invalid value of 'cpuset': %s"), tmp);
+        virBitmapFree(def);
+        def = NULL;
+        goto cleanup;
+    }
 
+ cleanup:
     VIR_FREE(tmp);
     return def;
 }