]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: parse: Assign maximum cpu count from topology if not provided
authorPeter Krempa <pkrempa@redhat.com>
Mon, 14 Nov 2016 13:52:30 +0000 (14:52 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 21 Nov 2016 13:35:20 +0000 (14:35 +0100)
qemu uses this if 'maxcpus' is not present. Do the same in the parsing
code.

src/qemu/qemu_parse_command.c

index 7ab3dcf5ba94ae1c6133e86e82aceef940a54d90..ed92caa328e18d4cba8cdb4ac3737aed279bc720 100644 (file)
@@ -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;