1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

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 <gaofeng@cn.fujitsu.com>
This commit is contained in:
Gao feng 2014-01-15 16:19:28 +08:00
parent 119eb4a140
commit 71f7d5840f

View 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;