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

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.
上级 1c888bad
......@@ -522,6 +522,7 @@ int openvzLoadDomains(struct openvz_driver *driver)
char *outbuf = NULL;
char *line;
virCommandPtr cmd = NULL;
unsigned int vcpus = 0;
if (openvzAssignUUIDs() < 0)
return -1;
......@@ -575,12 +576,14 @@ int openvzLoadDomains(struct openvz_driver *driver)
veid);
goto cleanup;
} else if (ret > 0) {
def->maxvcpus = strtoI(temp);
vcpus = strtoI(temp);
}
if (ret == 0 || def->maxvcpus == 0)
def->maxvcpus = openvzGetNodeCPUs();
def->vcpus = def->maxvcpus;
if (ret == 0 || vcpus == 0)
vcpus = openvzGetNodeCPUs();
def->maxvcpus = vcpus;
def->vcpus = vcpus;
/* XXX load rest of VM config data .... */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册