From 31b782a147b9b4a9aa758d8eba9fba5b72a6abb1 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 6 Jan 2016 15:34:13 +0100 Subject: [PATCH] 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 --- 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 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; -- 2.39.5