Re: [PATCH] LXC: show used memory as 0 when domain is not active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ping

> -----Original Message-----
> From: libvir-list-bounces@xxxxxxxxxx [mailto:libvir-list-bounces@xxxxxxxxxx]
> On Behalf Of Chen Hanxiao
> Sent: Thursday, July 17, 2014 5:28 PM
> To: libvir-list@xxxxxxxxxx
> Subject:  [PATCH] 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@xxxxxxxxxxxxxx>
> ---
>  src/lxc/lxc_driver.c   | 2 +-
>  src/qemu/qemu_driver.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
> index b7b4b02..f094f86 100644
> --- a/src/lxc/lxc_driver.c
> +++ b/src/lxc/lxc_driver.c
> @@ -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,
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 33541d3..01107cf 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -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;
> --
> 1.9.0
> 
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]