[libvirt] [PATCH 4/5] qemu: parse: Assign maximum cpu count from topology if not provided

Peter Krempa pkrempa at redhat.com
Mon Nov 14 16:53:50 UTC 2016


qemu uses this if 'maxcpus' is not present. Do the same in the parsing
code.
---
 src/qemu/qemu_parse_command.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index 7ab3dcf..ed92caa 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -1713,8 +1713,14 @@ qemuParseCommandLineSmp(virDomainDefPtr dom,
         goto syntax;
     }

-    if (maxcpus == 0)
-        maxcpus = vcpus;
+    if (maxcpus == 0) {
+        if (cores) {
+            if (virDomainDefGetVcpusTopology(dom, &maxcpus) < 0)
+                goto error;
+        } else {
+            maxcpus = vcpus;
+        }
+    }

     if (maxcpus == 0)
         goto syntax;
-- 
2.10.2




More information about the libvir-list mailing list