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: