From: Peter Krempa Date: Wed, 6 Jan 2016 14:34:13 +0000 (+0100) Subject: conf: disallow empty cpusets for vcpu pinning when parsing XML X-Git-Tag: v1.3.2-rc1~289 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31b782a147b9b4a9aa758d8eba9fba5b72a6abb1;p=thirdparty%2Flibvirt.git conf: disallow empty cpusets for vcpu pinning when parsing XML They are disallowed in the pinning API and as default cpuset. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1293241 --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 602ec64d50..68287f3d7d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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;