[PATCH] qemu: remove memset params array to zero in qemuDomainGetPercpuStats

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

 



the array params is allocated by VIR_ALLOC_N in cmdCPUStats.
it had been set to zero. No need to reset it to zero again,
and this reset here is incorrect too, nparams * ncpus is the
array length not the size of params array.

Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9f71160..7a329f0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15820,7 +15820,6 @@ qemuDomainGetPercpuStats(virDomainObjPtr vm,
     if (virCgroupGetCpuacctPercpuUsage(priv->cgroup, &buf))
         goto cleanup;
     pos = buf;
-    memset(params, 0, nparams * ncpus);
 
     /* return percpu cputime in index 0 */
     param_idx = 0;
-- 
1.8.4.2

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