From: Peter Krempa Date: Mon, 14 Nov 2016 13:46:03 +0000 (+0100) Subject: qemu: parse: Validate that the VM has at least one cpu X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4d72d80665630a9098801b19c144aaa16217661f;p=libvirt.git qemu: parse: Validate that the VM has at least one cpu 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. --- diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index c3b27aac8e..b19c523939 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;