提交 4d72d806 编写于 作者: P Peter Krempa

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.
上级 d29ba605
...@@ -1702,6 +1702,9 @@ qemuParseCommandLineSmp(virDomainDefPtr dom, ...@@ -1702,6 +1702,9 @@ qemuParseCommandLineSmp(virDomainDefPtr dom,
if (maxcpus == 0) if (maxcpus == 0)
maxcpus = vcpus; maxcpus = vcpus;
if (maxcpus == 0)
goto syntax;
if (virDomainDefSetVcpusMax(dom, maxcpus, xmlopt) < 0) if (virDomainDefSetVcpusMax(dom, maxcpus, xmlopt) < 0)
goto error; goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册