]> git.proxmox.com Git - pve-container.git/commitdiff
fixes #1227: include ns/ dir in read_cgroup_value
authorPhilip Abernethy <p.abernethy@proxmox.com>
Fri, 6 Oct 2017 13:52:15 +0000 (15:52 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 11 Oct 2017 12:51:15 +0000 (14:51 +0200)
this fixes the disk I/O graph and now also correctly sums the values.

src/PVE/LXC.pm

index bce032ae0adbc494afab82073f927ee57d124f10..6246e7b0090ec4180272294710f9f41ad85671f8 100644 (file)
@@ -197,8 +197,8 @@ sub vmstatus {
        my @bytes = split(/\n/, $blkio_bytes);
        foreach my $byte (@bytes) {
            if (my ($key, $value) = $byte =~ /(Read|Write)\s+(\d+)/) {
-               $d->{diskread} = $2 if $key eq 'Read';
-               $d->{diskwrite} = $2 if $key eq 'Write';
+               $d->{diskread} += $2 if $key eq 'Read';
+               $d->{diskwrite} += $2 if $key eq 'Write';
            }
        }
 
@@ -260,7 +260,7 @@ sub read_cgroup_list {
 sub read_cgroup_value {
     my ($group, $vmid, $name, $full) = @_;
 
-    my $path = "/sys/fs/cgroup/$group/lxc/$vmid/$name";
+    my $path = "/sys/fs/cgroup/$group/lxc/$vmid/ns/$name";
 
     return PVE::Tools::file_get_contents($path) if $full;