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
This commit is contained in:
Peter Krempa 2016-01-06 15:34:13 +01:00
parent 414b7eeae9
commit 31b782a147
1 changed files with 6 additions and 0 deletions

View 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;