From 4d72d80665630a9098801b19c144aaa16217661f Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 14 Nov 2016 14:46:03 +0100 Subject: [PATCH] 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. --- 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 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; -- 2.47.2