[PATCH] LXC: check whether we get MemSwap[Total|Usage]

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

 



Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
---
 src/lxc/lxc_cgroup.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index 8dfdc60..39e30ad 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -288,8 +288,11 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo)
     if (virLXCCgroupGetMemUsage(cgroup, meminfo) < 0)
         goto cleanup;
 
-    virLXCCgroupGetMemSwapTotal(cgroup, meminfo);
-    virLXCCgroupGetMemSwapUsage(cgroup, meminfo);
+    if (virLXCCgroupGetMemSwapTotal(cgroup, meminfo) < 0)
+        goto cleanup;
+
+    if (virLXCCgroupGetMemSwapUsage(cgroup, meminfo) < 0)
+        goto cleanup;
 
     ret = 0;
  cleanup:
-- 
1.9.0

--
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]