diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 1a7cc787feadb33c20db981bdd9a0b98fcd4de90..35df18f2d3ca4a1d9e52c4b341a205f12d37f185 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -597,7 +597,7 @@ static int lxcDomainGetInfo(virDomainPtr dom, if (!virDomainObjIsActive(vm)) { info->cpuTime = 0; - info->memory = 0; + info->memory = vm->def->mem.cur_balloon; } else { if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) { virReportError(VIR_ERR_OPERATION_FAILED, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b263ce0c38dcd8db26200f5d6823d539f7f50dca..91eb6619243869ed440aec1ef94dc6bd2cf3de23 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2642,13 +2642,13 @@ qemuDomainGetInfo(virDomainPtr dom, goto cleanup; } - if (virDomainObjIsActive(vm)) { - if (VIR_ASSIGN_IS_OVERFLOW(info->memory, vm->def->mem.cur_balloon)) { - virReportError(VIR_ERR_OVERFLOW, "%s", - _("Current memory size too large")); - goto cleanup; - } + if (VIR_ASSIGN_IS_OVERFLOW(info->memory, vm->def->mem.cur_balloon)) { + virReportError(VIR_ERR_OVERFLOW, "%s", + _("Current memory size too large")); + goto cleanup; + } + if (virDomainObjIsActive(vm)) { if (qemuGetProcessInfo(&(info->cpuTime), NULL, NULL, vm->pid, 0) < 0) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("cannot read cputime for domain"));