提交 e29dfe9b 编写于 作者: P Peter Krempa

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.
上级 a44da44b
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册