To simplify further refactors change the way the vcpu count is extracted
to use a temp variable rather than juggling with def->maxvcpus.
char *val = NULL;
struct xen_vif_set *vif_set = NULL;
char *xml;
+ unsigned int vcpus;
/* Flags checked by virDomainDefFormat */
} else {
defPtr->mem.cur_balloon = memory;
}
- defPtr->maxvcpus = defPtr->vcpus = xenapiDomainGetMaxVcpus(dom);
+
+ vcpus = xenapiDomainGetMaxVcpus(dom);
+
+ defPtr->maxvcpus = vcpus;
+ defPtr->vcpus = vcpus;
+
enum xen_on_normal_exit action;
if (xen_vm_get_actions_after_shutdown(session, &action, vm))
defPtr->onPoweroff = xenapiNormalExitEnum2virDomainLifecycle(action);