From 0d9a76de6d68a9d4a107a741538300ae576bea98 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 14 Nov 2016 14:49:57 +0100 Subject: [PATCH] qemu: parse: Assign topology info earlier 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 98051be20d..7ab3dcf5ba 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: