[PATCHv2] numatune: Fix parsing of empty nodeset (0,^0)

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

 



Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1121837
---

Notes:
    Version 2:
    - reject empty bitmaps while parsing instead of just rejecting nodesets

 src/util/virbitmap.c     | 3 +++
 tests/qemuxml2argvtest.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c
index 27282df..b6bd074 100644
--- a/src/util/virbitmap.c
+++ b/src/util/virbitmap.c
@@ -378,6 +378,9 @@ virBitmapParse(const char *str,
         }
     }
 
+    if (virBitmapIsAllClear(*bitmap))
+        goto error;
+
     return virBitmapCountBits(*bitmap);
 
  error:
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 1c121ff..62b969c 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1210,6 +1210,7 @@ mymain(void)
     DO_TEST("cputune-zero-shares", QEMU_CAPS_NAME);
 
     DO_TEST("numatune-memory", NONE);
+    DO_TEST_PARSE_ERROR("numatune-memory-invalid-nodeset", NONE);
     DO_TEST("numatune-memnode", QEMU_CAPS_NUMA, QEMU_CAPS_OBJECT_MEMORY_RAM);
     DO_TEST_FAILURE("numatune-memnode", NONE);
 
-- 
1.9.3

--
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]