mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
openvz: 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
1c888bade5
commit
a44da44b1c
@ -522,6 +522,7 @@ int openvzLoadDomains(struct openvz_driver *driver)
|
|||||||
char *outbuf = NULL;
|
char *outbuf = NULL;
|
||||||
char *line;
|
char *line;
|
||||||
virCommandPtr cmd = NULL;
|
virCommandPtr cmd = NULL;
|
||||||
|
unsigned int vcpus = 0;
|
||||||
|
|
||||||
if (openvzAssignUUIDs() < 0)
|
if (openvzAssignUUIDs() < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -575,12 +576,14 @@ int openvzLoadDomains(struct openvz_driver *driver)
|
|||||||
veid);
|
veid);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if (ret > 0) {
|
} else if (ret > 0) {
|
||||||
def->maxvcpus = strtoI(temp);
|
vcpus = strtoI(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0 || def->maxvcpus == 0)
|
if (ret == 0 || vcpus == 0)
|
||||||
def->maxvcpus = openvzGetNodeCPUs();
|
vcpus = openvzGetNodeCPUs();
|
||||||
def->vcpus = def->maxvcpus;
|
|
||||||
|
def->maxvcpus = vcpus;
|
||||||
|
def->vcpus = vcpus;
|
||||||
|
|
||||||
/* XXX load rest of VM config data .... */
|
/* XXX load rest of VM config data .... */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user