]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Clean up virCgroupGetPercpuStats
authorJán Tomko <jtomko@redhat.com>
Thu, 3 Apr 2014 17:23:25 +0000 (19:23 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 9 Apr 2014 14:24:08 +0000 (16:24 +0200)
commit2adf59ebde602b4bfa757f96c39274000be44619
treeba9b5fa99ba2ba2b0e242c06907e0d93b2ef4043
parent9fe5267adecc6c87074ce673626a73ea4d9f2d6e
Clean up virCgroupGetPercpuStats

The iterator is checked for being less than or equal to need_cpus.
The 'n' variable is incremented need_cpus + 1 times.

Simplify the computation of need_cpus and make its value one larger,
to let it be used instead of 'n' and compared without the equal sign
in loop conditions.

Just index the sum_cpu_time array instead of using a helper variable.

Start the loop at start_cpu instead of continuing for all lower values.
src/util/vircgroup.c