public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] procfstools: use absolute path when reading PSI from sysfs
@ 2025-07-31  9:58 Lukas Wagner
  2025-07-31 10:08 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wagner @ 2025-07-31  9:58 UTC (permalink / raw)
  To: pve-devel

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@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-31 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-31  9:58 [pve-devel] [PATCH common] procfstools: use absolute path when reading PSI from sysfs Lukas Wagner
2025-07-31 10:08 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal