[libvirt] [PATCH 22/34] conf: disallow empty cpusets for vcpu pinning when parsing XML

Peter Krempa pkrempa at redhat.com
Thu Jan 14 16:27:10 UTC 2016


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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 4b4a36e..1036057 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14137,6 +14137,12 @@ virDomainVcpuPinDefParseXML(virDomainDefPtr def,
     if (virBitmapParse(tmp, 0, &vcpu->cpumask, VIR_DOMAIN_CPUMASK_LEN) < 0)
         goto cleanup;

+    if (virBitmapIsAllClear(vcpu->cpumask)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("Invalid value of 'cpuset': %s"), tmp);
+        goto cleanup;
+    }
+
     ret = 0;

  cleanup:
-- 
2.6.2




More information about the libvir-list mailing list