Commit 3172ae64 authored by Dietmar Maurer's avatar Dietmar Maurer

use other way to compute openvz swap usage

parent 41111bdc
......@@ -201,11 +201,11 @@ sub vmstatus {
my $d = $list->{$vmid};
if ($d && defined($d->{status})) {
$d->{failcnt} += $failcnt;
if ($name eq 'physpages') {
$d->{mem} += int($held * 4096);
} elsif ($name eq 'swappages') {
$d->{mem} += int($held * 4096);
$d->{swap} += int($held * 4096);
if ($name eq 'privvmpages') { # mem + swap - really?
$d->{mem} = int($held * 4096);
} elsif ($name eq 'physpages') {
my $phy = int($held * 4096);
$d->{swap} = $phy > $d->{maxmem} ? $phy - $d->{maxmem} : 0;
} elsif ($name eq 'numproc') {
$d->{nproc} = $held;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment