mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
LXC: show used memory as 0 when domain is not active
Before: virsh # dominfo chx3 State: shut off Max memory: 92160 KiB Used memory: 92160 KiB After: virsh # dominfo container1 State: shut off Max memory: 92160 KiB Used memory: 0 KiB Similar to qemu cases. Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This commit is contained in:
parent
26d67015b8
commit
1ce7c1d20c
@ -584,7 +584,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
info->cpuTime = 0;
|
||||
info->memory = vm->def->mem.cur_balloon;
|
||||
info->memory = 0;
|
||||
} else {
|
||||
if (virCgroupGetCpuacctUsage(priv->cgroup, &(info->cpuTime)) < 0) {
|
||||
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||
|
@ -2534,7 +2534,7 @@ static int qemuDomainGetInfo(virDomainPtr dom,
|
||||
info->memory = vm->def->mem.cur_balloon;
|
||||
}
|
||||
} else {
|
||||
info->memory = vm->def->mem.cur_balloon;
|
||||
info->memory = 0;
|
||||
}
|
||||
|
||||
info->nrVirtCpu = vm->def->vcpus;
|
||||
|
Loading…
Reference in New Issue
Block a user