From: Peter Krempa Date: Wed, 11 Feb 2015 16:38:29 +0000 (+0100) Subject: conf: numa: Improve error message in case a numa node doesn't have cpus X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=60a2ce4962f932eaf984a6b7b8c78e1fd0218f54;p=libvirt.git conf: numa: Improve error message in case a numa node doesn't have cpus Currently the code would exit without reporting an error as virBitmapParse reports one only if it fails to parse the bitmap, whereas the code was jumping to the error label even in case 0 cpus were correctly parsed in the map. --- diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index d21d62e745..39061adc86 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -749,9 +749,14 @@ virDomainNumaDefCPUParseXML(virCPUDefPtr def, } if (virBitmapParse(tmp, 0, &def->cells[cur_cell].cpumask, - VIR_DOMAIN_CPUMASK_LEN) <= 0) + VIR_DOMAIN_CPUMASK_LEN) < 0) goto cleanup; + if (virBitmapIsAllClear(def->cells[cur_cell].cpumask)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("NUMA cell %d has no vCPUs assigned"), cur_cell); + goto cleanup; + } VIR_FREE(tmp); ctxt->node = nodes[i];