From: Peter Krempa Date: Wed, 6 Jan 2016 15:07:42 +0000 (+0100) Subject: conf: disallow empty cpuset for emulatorpin X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=763941749eaa206d5c66e87e59c967814cbd6a27;p=libvirt.git conf: disallow empty cpuset for emulatorpin It's disallowed in the API. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 68287f3d7d..1ea74a6ad6 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14275,8 +14275,18 @@ virDomainEmulatorPinDefParseXML(xmlNodePtr node) return NULL; } - ignore_value(virBitmapParse(tmp, 0, &def, VIR_DOMAIN_CPUMASK_LEN)); + if (virBitmapParse(tmp, 0, &def, VIR_DOMAIN_CPUMASK_LEN) < 0) + goto cleanup; + + if (virBitmapIsAllClear(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Invalid value of 'cpuset': %s"), tmp); + virBitmapFree(def); + def = NULL; + goto cleanup; + } + cleanup: VIR_FREE(tmp); return def; }