Revert "LXC: show used memory as 0 when domain is not active"

This reverts commit 1ce7c1d20cfd5afb26d2dbc88201085d52415d0e,
which introduced a significant semantic change to the
virDomainGetInfo() API. Additionally, the change was only
made to 2 of the 15 virt drivers.

Conflicts:
	src/qemu/qemu_driver.c

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2015-08-10 12:49:55 -06:00
parent e80b84a743
commit 60acb38abb
2 changed files with 7 additions and 7 deletions

View File

@ -597,7 +597,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
info->cpuTime = 0; info->cpuTime = 0;
info->memory = 0; info->memory = vm->def->mem.cur_balloon;
} else { } else {
if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) { if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,

View File

@ -2642,13 +2642,13 @@ qemuDomainGetInfo(virDomainPtr dom,
goto cleanup; goto cleanup;
} }
if (virDomainObjIsActive(vm)) {
if (VIR_ASSIGN_IS_OVERFLOW(info->memory, vm->def->mem.cur_balloon)) { if (VIR_ASSIGN_IS_OVERFLOW(info->memory, vm->def->mem.cur_balloon)) {
virReportError(VIR_ERR_OVERFLOW, "%s", virReportError(VIR_ERR_OVERFLOW, "%s",
_("Current memory size too large")); _("Current memory size too large"));
goto cleanup; goto cleanup;
} }
if (virDomainObjIsActive(vm)) {
if (qemuGetProcessInfo(&(info->cpuTime), NULL, NULL, vm->pid, 0) < 0) { if (qemuGetProcessInfo(&(info->cpuTime), NULL, NULL, vm->pid, 0) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s", virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("cannot read cputime for domain")); _("cannot read cputime for domain"));