mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
phyp: Refactor extraction of vcpu count
To simplify further refactors change the way the vcpu count is extracted to use a temp variable rather than juggling with def.maxvcpus.
This commit is contained in:
parent
a44da44b1c
commit
e29dfe9b27
@ -3255,6 +3255,7 @@ phypDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
||||
virDomainDef def;
|
||||
char *managed_system = phyp_driver->managed_system;
|
||||
unsigned long long memory;
|
||||
unsigned int vcpus;
|
||||
|
||||
/* Flags checked by virDomainDefFormat */
|
||||
|
||||
@ -3289,12 +3290,14 @@ phypDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((def.maxvcpus = def.vcpus =
|
||||
phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) {
|
||||
if ((vcpus = phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) {
|
||||
VIR_ERROR(_("Unable to determine domain's CPU."));
|
||||
goto err;
|
||||
}
|
||||
|
||||
def.maxvcpus = vcpus;
|
||||
def.vcpus = vcpus;
|
||||
|
||||
return virDomainDefFormat(&def,
|
||||
virDomainDefFormatConvertXMLFlags(flags));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user