]> xenbits.xensource.com Git - libvirt.git/commit
util: Fix virCgroupGetMemoryStat
authorPeter Chubb <Peter.Chubb@data61.csiro.au>
Wed, 7 Nov 2018 23:40:24 +0000 (18:40 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 14 Nov 2018 19:45:02 +0000 (14:45 -0500)
commitb8176d6eaa943bc9825ecc99d86c0c301e688dd0
tree7ac84e871b5b28c23b8f7ac34c0d68ae5d1d71a9
parentb04b82f8cb671f067bad2d5e922acf88f13f0934
util: Fix virCgroupGetMemoryStat

Commit 901d2b9c introduced virCgroupGetMemoryStat and replaced
the LXC virLXCCgroupGetMemStat logic in commit e634c7cd0. However,
in doing so the replacement wasn't exact as the LXC logic used
getline() to process the cgroup controller data, while the new
virCgroupGetMemoryStat used "memory.stat" manual buffer read/
processing which neglected to forward through @line in order
to read each line in the output.

To fix that, we should be sure to carry forward the @line value
for each line read updating it beyond that current @newLine value
once we've calculated the values that we want.

Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/util/vircgroupv1.c
src/util/vircgroupv2.c