Libvirt's code relies on this fact so don't allow parsing a command line
which would have none.
Libvirtd would crash in the post parse callback on such config.
---
src/qemu/qemu_parse_command.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index c3b27aa..b19c523 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -1702,6 +1702,9 @@ qemuParseCommandLineSmp(virDomainDefPtr dom,
if (maxcpus == 0)
maxcpus = vcpus;
+ if (maxcpus == 0)
+ goto syntax;
+
if (virDomainDefSetVcpusMax(dom, maxcpus, xmlopt) < 0)
goto error;
--
2.10.2