]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: parse: Assign topology info earlier
authorPeter Krempa <pkrempa@redhat.com>
Mon, 14 Nov 2016 13:49:57 +0000 (14:49 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 21 Nov 2016 13:35:20 +0000 (14:35 +0100)
Qemu can also use the topology to calculate the total vcpu count. To
allow parsing this move the assignment earlier.

src/qemu/qemu_parse_command.c

index 98051be20d88e0a8e2df3d3d6f9d2ca279507b42..7ab3dcf5ba94ae1c6133e86e82aceef940a54d90 100644 (file)
@@ -1701,18 +1701,6 @@ qemuParseCommandLineSmp(virDomainDefPtr dom,
         }
     }
 
-    if (maxcpus == 0)
-        maxcpus = vcpus;
-
-    if (maxcpus == 0)
-        goto syntax;
-
-    if (virDomainDefSetVcpusMax(dom, maxcpus, xmlopt) < 0)
-        goto error;
-
-    if (virDomainDefSetVcpus(dom, vcpus) < 0)
-        goto error;
-
     if (sockets && cores && threads) {
         virCPUDefPtr cpu;
 
@@ -1725,6 +1713,18 @@ qemuParseCommandLineSmp(virDomainDefPtr dom,
         goto syntax;
     }
 
+    if (maxcpus == 0)
+        maxcpus = vcpus;
+
+    if (maxcpus == 0)
+        goto syntax;
+
+    if (virDomainDefSetVcpusMax(dom, maxcpus, xmlopt) < 0)
+        goto error;
+
+    if (virDomainDefSetVcpus(dom, vcpus) < 0)
+        goto error;
+
     ret = 0;
 
  cleanup: