From e29dfe9b27f6c81592ae805c256f8d25216ad2f8 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 16 Oct 2015 15:38:48 +0200 Subject: [PATCH] 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. --- src/phyp/phyp_driver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 2912fc4029..14264c0ce2 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -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)); -- GitLab