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 { ...@@ -201,11 +201,11 @@ sub vmstatus {
my $d = $list->{$vmid}; my $d = $list->{$vmid};
if ($d && defined($d->{status})) { if ($d && defined($d->{status})) {
$d->{failcnt} += $failcnt; $d->{failcnt} += $failcnt;
if ($name eq 'physpages') { if ($name eq 'privvmpages') { # mem + swap - really?
$d->{mem} += int($held * 4096); $d->{mem} = int($held * 4096);
} elsif ($name eq 'swappages') { } elsif ($name eq 'physpages') {
$d->{mem} += int($held * 4096); my $phy = int($held * 4096);
$d->{swap} += int($held * 4096); $d->{swap} = $phy > $d->{maxmem} ? $phy - $d->{maxmem} : 0;
} elsif ($name eq 'numproc') { } elsif ($name eq 'numproc') {
$d->{nproc} = $held; $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