From: Peter Krempa Date: Mon, 14 Nov 2016 13:49:57 +0000 (+0100) Subject: qemu: parse: Assign topology info earlier X-Git-Tag: v2.5.0-rc1~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d9a76de6d68a9d4a107a741538300ae576bea98;p=thirdparty%2Flibvirt.git 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. --- 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: