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

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

 



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

--
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]