[libvirt] [PATCH] lxc: don't update memUsage when failing to get memory usage

chenhanxiao at cn.fujitsu.com chenhanxiao at cn.fujitsu.com
Mon Jun 23 06:55:18 UTC 2014


ping

> -----Original Message-----
> From: libvir-list-bounces at redhat.com [mailto:libvir-list-bounces at redhat.com]
> On Behalf Of Chen Hanxiao
> Sent: Friday, June 20, 2014 2:21 PM
> To: libvir-list at redhat.com
> Subject: [libvirt] [PATCH] lxc: don't update memUsage when failing to get memory
> usage
> 
> Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> ---
>  src/lxc/lxc_cgroup.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
> index 8dfdc60..af95941 100644
> --- a/src/lxc/lxc_cgroup.c
> +++ b/src/lxc/lxc_cgroup.c
> @@ -194,7 +194,8 @@ static int virLXCCgroupGetMemUsage(virCgroupPtr cgroup,
>      unsigned long memUsage;
> 
>      ret = virCgroupGetMemoryUsage(cgroup, &memUsage);
> -    meminfo->memusage = (unsigned long long) memUsage;
> +    if (ret == 0)
> +        meminfo->memusage = (unsigned long long) memUsage;
> 
>      return ret;
>  }
> --
> 1.9.0
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list




More information about the libvir-list mailing list