From: Gao feng Date: Wed, 15 Jan 2014 08:19:28 +0000 (+0800) Subject: qemu: remove memset params array to zero in qemuDomainGetPercpuStats X-Git-Tag: v1.2.2-rc1~228 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71f7d5840fea6808895387a26133dcf738dc0eda;p=thirdparty%2Flibvirt.git qemu: remove memset params array to zero in qemuDomainGetPercpuStats 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 --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6e2126760c..a7ef209dd3 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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;