mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-19 14:10:58 +00:00
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:
parent
d78a8c26c2
commit
0d9a76de6d
@ -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) {
|
if (sockets && cores && threads) {
|
||||||
virCPUDefPtr cpu;
|
virCPUDefPtr cpu;
|
||||||
|
|
||||||
@ -1725,6 +1713,18 @@ qemuParseCommandLineSmp(virDomainDefPtr dom,
|
|||||||
goto syntax;
|
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;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
Reference in New Issue
Block a user