mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
Revert "LXC: show used memory as 0 when domain is not active"
This reverts commit1ce7c1d20c
, 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> (cherry picked from commit60acb38abb
)
This commit is contained in:
parent
45e32f2ea5
commit
a0080cbc17
@ -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,
|
||||
|
@ -2641,13 +2641,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"));
|
||||
|
Loading…
Reference in New Issue
Block a user