mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-28 08:22:16 +00:00
fix bug 22: correctly display openvz swap usage
This commit is contained in:
parent
ed434a6cab
commit
a003717b9b
@ -114,7 +114,8 @@ sub get_rootdir {
|
|||||||
|
|
||||||
sub read_user_beancounters {
|
sub read_user_beancounters {
|
||||||
my $ubc = {};
|
my $ubc = {};
|
||||||
if (my $fh = IO::File->new ("/proc/user_beancounters", "r")) {
|
|
||||||
|
if (my $fh = IO::File->new ("/proc/bc/resources", "r")) {
|
||||||
my $vmid;
|
my $vmid;
|
||||||
while (defined (my $line = <$fh>)) {
|
while (defined (my $line = <$fh>)) {
|
||||||
if ($line =~ m|\s*((\d+):\s*)?([a-z]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$|) {
|
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();
|
my $ubchash = read_user_beancounters();
|
||||||
foreach my $vmid (keys %$ubchash) {
|
foreach my $vmid (keys %$ubchash) {
|
||||||
my $d = $list->{$vmid};
|
my $d = $list->{$vmid};
|
||||||
my $ubc = $ubchash->{$vmid};
|
my $ubc = $ubchash->{$vmid};
|
||||||
if ($d && defined($d->{status}) && $ubc) {
|
if ($d && defined($d->{status}) && $ubc) {
|
||||||
$d->{failcnt} = $ubc->{failcntsum};
|
$d->{failcnt} = $ubc->{failcntsum};
|
||||||
$d->{mem} = int($ubc->{privvmpages}->{held} * 4096);
|
$d->{mem} = $ubc->{physpages}->{held} * 4096;
|
||||||
my $phy = int($ubc->{physpages}->{held} * 4096);
|
if ($ubc->{swappages}->{held} < $maxpages) {
|
||||||
$d->{swap} = $phy > $d->{maxmem} ? $phy - $d->{maxmem} : 0;
|
$d->{swap} = $ubc->{swappages}->{held} * 4096
|
||||||
|
}
|
||||||
$d->{nproc} = $ubc->{numproc}->{held};
|
$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
|
pve-manager (2.0-39) unstable; urgency=low
|
||||||
|
|
||||||
* add Spanish translation
|
* add Spanish translation
|
||||||
|
@ -2,7 +2,7 @@ RELEASE=2.0
|
|||||||
|
|
||||||
VERSION=2.0
|
VERSION=2.0
|
||||||
PACKAGE=pve-manager
|
PACKAGE=pve-manager
|
||||||
PACKAGERELEASE=39
|
PACKAGERELEASE=40
|
||||||
|
|
||||||
BINDIR=${DESTDIR}/usr/bin
|
BINDIR=${DESTDIR}/usr/bin
|
||||||
PERLLIBDIR=${DESTDIR}/usr/share/perl5
|
PERLLIBDIR=${DESTDIR}/usr/share/perl5
|
||||||
|
Loading…
Reference in New Issue
Block a user