]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: disallow empty cpusets for vcpu pinning when parsing XML
authorPeter Krempa <pkrempa@redhat.com>
Wed, 6 Jan 2016 14:34:13 +0000 (15:34 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Jan 2016 16:27:54 +0000 (17:27 +0100)
They are disallowed in the pinning API and as default cpuset.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1293241

src/conf/domain_conf.c

index 602ec64d508d3b0c8d485a8477cc711d64425658..68287f3d7d4db44442ff06a1e64a1f5fa32bb4aa 100644 (file)
@@ -14163,6 +14163,12 @@ virDomainVcpuPinDefParseXML(xmlNodePtr node,
     if (virBitmapParse(tmp, 0, &def->cpumask, VIR_DOMAIN_CPUMASK_LEN) < 0)
         goto error;
 
+    if (virBitmapIsAllClear(def->cpumask)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("Invalid value of 'cpuset': %s"), tmp);
+        goto error;
+    }
+
  cleanup:
     VIR_FREE(tmp);
     ctxt->node = oldnode;