mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +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) {
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user