[libvirt] [PATCH 3/5] qemu: parse: Assign topology info earlier

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


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 | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
index 98051be..7ab3dcf 100644
--- a/src/qemu/qemu_parse_command.c
+++ b/src/qemu/qemu_parse_command.c
@@ -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:
-- 
2.10.2




More information about the libvir-list mailing list