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.
This commit is contained in:
Peter Krempa 2016-11-14 14:49:57 +01:00
parent d78a8c26c2
commit 0d9a76de6d

View File

@ -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: