[PATCH 1/5] qemu: parse: Validate that the VM has at least one cpu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 c3b27aa..b19c523 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.10.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]