vzlist: fix cpulimit rounding
As pointed out by Kevin,
> When setting a cpulimit with vzctl which cannot be divided by /25
> without getting a decimal, vzlist then shows an off value.
>
> For example:
> :~# setgetlim(){ vzctl --quiet set 810 --cpulimit $1; vzlist -Ho cpulimit 810; }
> :~# for lim in $(seq 0 800); do if [ $lim == $(setgetlim $lim) ]; then
> echo $lim; fi; done
> 0
> 25
> 50
> 75
Fix by using double for calculation and rounding the result.
https://bugzilla.openvz.org/3063
Reported-by: Kevin Holly <root@hallowe.lt>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
3 files changed