[pve-devel] [PATCH common] procfstools: use absolute path when reading PSI from sysfs

Lukas Wagner l.wagner at proxmox.com
Thu Jul 31 11:58:04 CEST 2025


With the newly introduced PSI parsing from sysfs, a `qm list` reported
uninitialized values.

$ qm list
Use of uninitialized value in multiplication (*) at /usr/share/perl5/PVE/QemuServer.pm line 2716.
Use of uninitialized value in multiplication (*) at /usr/share/perl5/PVE/QemuServer.pm line 2717.
Use of uninitialized value in multiplication (*) at /usr/share/perl5/PVE/QemuServer.pm line 2718.
Use of uninitialized value in multiplication (*) at /usr/share/perl5/PVE/QemuServer.pm line 2719.
Use of uninitialized value in multiplication (*) at /usr/share/perl5/PVE/QemuServer.pm line 2720.
....

Digging into the source code of qemu-server showed that the call to
read_cgroup_pressure returned undef. The cause was a missing /-prefix
for the sysfs path, which made it a relative path instead of an absolute
path. For pvestatd this was fine, since this daemon uses `/` as a
working directory.

Reported-by: Hannes Dürr <h.duerr at proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 src/PVE/ProcFSTools.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index f28372b..9bfac2c 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -156,7 +156,7 @@ sub read_cgroup_pressure {
 
     my $res = {};
     for my $type (qw(cpu memory io)) {
-        my $stats = parse_pressure("sys/fs/cgroup/${cgroup_path}/${type}.pressure");
+        my $stats = parse_pressure("/sys/fs/cgroup/${cgroup_path}/${type}.pressure");
         $res->{$type} = $stats if $stats;
     }
     return $res;
-- 
2.47.2





More information about the pve-devel mailing list