diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 27282df9e7..b6bd074cf4 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/qemuxml2argvdata/qemuxml2argv-numatune-memory-invalid-nodeset.xml b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory-invalid-nodeset.xml new file mode 100644 index 0000000000..079ca9d5ec --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-numatune-memory-invalid-nodeset.xml @@ -0,0 +1,31 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 2 + + + + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu + + + +
+ + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1c121ffd3c..62b969c359 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);