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.
This commit is contained in:
Peter Krempa 2016-11-14 14:46:03 +01:00
parent d29ba605af
commit 4d72d80665

View File

@ -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;