fix bug 22: correctly display openvz swap usage
This commit is contained in:
parent
322ce4c4ce
commit
9db22c33c7
@ -114,7 +114,8 @@ sub get_rootdir {
|
||||
|
||||
sub read_user_beancounters {
|
||||
my $ubc = {};
|
||||
if (my $fh = IO::File->new ("/proc/user_beancounters", "r")) {
|
||||
|
||||
if (my $fh = IO::File->new ("/proc/bc/resources", "r")) {
|
||||
my $vmid;
|
||||
while (defined (my $line = <$fh>)) {
|
||||
if ($line =~ m|\s*((\d+):\s*)?([a-z]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$|) {
|
||||
@ -240,15 +241,17 @@ sub vmstatus {
|
||||
}
|
||||
}
|
||||
|
||||
my $maxpages = ($res_unlimited / 4096);
|
||||
my $ubchash = read_user_beancounters();
|
||||
foreach my $vmid (keys %$ubchash) {
|
||||
my $d = $list->{$vmid};
|
||||
my $ubc = $ubchash->{$vmid};
|
||||
if ($d && defined($d->{status}) && $ubc) {
|
||||
$d->{failcnt} = $ubc->{failcntsum};
|
||||
$d->{mem} = int($ubc->{privvmpages}->{held} * 4096);
|
||||
my $phy = int($ubc->{physpages}->{held} * 4096);
|
||||
$d->{swap} = $phy > $d->{maxmem} ? $phy - $d->{maxmem} : 0;
|
||||
$d->{mem} = $ubc->{physpages}->{held} * 4096;
|
||||
if ($ubc->{swappages}->{held} < $maxpages) {
|
||||
$d->{swap} = $ubc->{swappages}->{held} * 4096
|
||||
}
|
||||
$d->{nproc} = $ubc->{numproc}->{held};
|
||||
}
|
||||
}
|
||||
|
6
debian/changelog.Debian
vendored
6
debian/changelog.Debian
vendored
@ -1,3 +1,9 @@
|
||||
pve-manager (2.0-40) unstable; urgency=low
|
||||
|
||||
* fix bug 22: correctly display openvz swap usage
|
||||
|
||||
-- Proxmox Support Team <support@proxmox.com> Wed, 14 Mar 2012 16:00:32 +0100
|
||||
|
||||
pve-manager (2.0-39) unstable; urgency=low
|
||||
|
||||
* add Spanish translation
|
||||
|
@ -2,7 +2,7 @@ RELEASE=2.0
|
||||
|
||||
VERSION=2.0
|
||||
PACKAGE=pve-manager
|
||||
PACKAGERELEASE=39
|
||||
PACKAGERELEASE=40
|
||||
|
||||
BINDIR=${DESTDIR}/usr/bin
|
||||
PERLLIBDIR=${DESTDIR}/usr/share/perl5
|
||||
|
Loading…
x
Reference in New Issue
Block a user