]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: remove memset params array to zero in qemuDomainGetPercpuStats
authorGao feng <gaofeng@cn.fujitsu.com>
Wed, 15 Jan 2014 08:19:28 +0000 (16:19 +0800)
committerGao feng <gaofeng@cn.fujitsu.com>
Fri, 24 Jan 2014 08:31:53 +0000 (16:31 +0800)
the array params is allocated by VIR_ALLOC_N in
remoteDispatchDomainGetCPUStats. 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@cn.fujitsu.com>
src/qemu/qemu_driver.c

index 6e2126760ca691cb5322ecff9eba2d6cb6504259..a7ef209dd3fe0ba8c66d065ae2c1c40f61836b06 100644 (file)
@@ -15881,7 +15881,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;