public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common] procfstools: use absolute path when reading PSI from sysfs
Date: Thu, 31 Jul 2025 11:58:04 +0200	[thread overview]
Message-ID: <20250731095804.1177096-1-l.wagner@proxmox.com> (raw)

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

             reply	other threads:[~2025-07-31  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31  9:58 Lukas Wagner [this message]
2025-07-31 10:08 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250731095804.1177096-1-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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