[libvirt] [PATCH 2/6] Fix return value of virCgroupGetPercpuStats

Ján Tomko jtomko at redhat.com
Fri Apr 4 08:25:36 UTC 2014


We need to return the number of successfully populated stats,
not the nparams supplied by the user.
---
 src/util/vircgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index b881c8c..1ff3dad 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -2897,7 +2897,7 @@ virCgroupGetPercpuStats(virCgroupPtr group,
             goto cleanup;
     }
 
-    rv = nparams;
+    rv = param_idx + 1;
 
  cleanup:
     VIR_FREE(buf);
-- 
1.8.3.2




More information about the libvir-list mailing list