mirror of https://gitee.com/openkylin/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.
This commit is contained in:
parent
d29ba605af
commit
4d72d80665
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue