[PATCH 09/24] conf: numa: Improve error message in case a numa node doesn't have cpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 src/conf/numa_conf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index 41a7e01..391ef15 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];
-- 
2.2.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]