conf: disallow empty cpuset for emulatorpin

It's disallowed in the API.
This commit is contained in:
Peter Krempa 2016-01-06 16:07:42 +01:00
parent 31b782a147
commit 763941749e
1 changed files with 11 additions and 1 deletions

View File

@ -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;
}