From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common 3/3] upid: fix calls to decode function
Date: Wed, 1 Oct 2025 11:36:42 +0200 [thread overview]
Message-ID: <20251001093750.51078-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20251001093750.51078-1-f.ebner@proxmox.com>
The decode function has a signature and always requires two arguments.
Otherwise, there will be errors like:
> Too few arguments for subroutine 'PVE::UPID::decode'
> (got 1; expected 2) at /usr/share/perl5/PVE/UPID.pm line 60.
Fixes: 5600b0b ("create dedicated PVE::UPID module")
Fixes: ea99050 ("switch to using split out PVE::UPID")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/ProcFSTools.pm | 2 +-
src/PVE/RESTEnvironment.pm | 4 ++--
src/PVE/UPID.pm | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm
index 51a2e79..a8d66d7 100644
--- a/src/PVE/ProcFSTools.pm
+++ b/src/PVE/ProcFSTools.pm
@@ -525,7 +525,7 @@ sub read_proc_net_ipv6_route {
sub upid_wait {
my ($upid, $waitfunc, $sleep_intervall) = @_;
- my $task = PVE::UPID::decode($upid);
+ my $task = PVE::UPID::decode($upid, 0);
$sleep_intervall = $sleep_intervall ? $sleep_intervall : 1;
diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm
index 7695850..197cc22 100644
--- a/src/PVE/RESTEnvironment.pm
+++ b/src/PVE/RESTEnvironment.pm
@@ -312,7 +312,7 @@ sub active_workers {
}
if ($new_upid && !$thash->{$new_upid}) {
- my $task = PVE::UPID::decode($new_upid);
+ my $task = PVE::UPID::decode($new_upid, 0);
$task->{upid} = $new_upid;
$thash->{$new_upid} = $task;
&$check_task($task, $nocheck);
@@ -406,7 +406,7 @@ my $kill_process_group = sub {
sub check_worker {
my ($self, $upid, $killit) = @_;
- my $task = PVE::UPID::decode($upid);
+ my $task = PVE::UPID::decode($upid, 0);
my $running = PVE::ProcFSTools::check_process_running($task->{pid}, $task->{pstart});
diff --git a/src/PVE/UPID.pm b/src/PVE/UPID.pm
index 1256ec3..9913531 100644
--- a/src/PVE/UPID.pm
+++ b/src/PVE/UPID.pm
@@ -59,7 +59,7 @@ sub decode($upid, $noerr) {
}
sub open_log($upid) {
- my ($task, $filename) = decode($upid);
+ my ($task, $filename) = decode($upid, 0);
my $dirname = dirname($filename);
make_path($dirname);
@@ -77,7 +77,7 @@ sub open_log($upid) {
}
sub read_status($upid) {
- my ($task, $filename) = decode($upid);
+ my ($task, $filename) = decode($upid, 0);
my $fh = IO::File->new($filename, "r") or return "unable to open file - $!";
my $maxlen = 4096;
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-10-01 9:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 9:36 [pve-devel] [PATCH common 0/3] upid: fix calls to decode Fiona Ebner
2025-10-01 9:36 ` [pve-devel] [PATCH common 1/3] upid: order imports alphabetically Fiona Ebner
2025-10-01 10:32 ` [pve-devel] applied: " Thomas Lamprecht
2025-10-01 9:36 ` [pve-devel] [PATCH common 2/3] upid: add missing imports Fiona Ebner
2025-10-01 9:36 ` Fiona Ebner [this message]
2025-10-01 10:34 ` [pve-devel] [PATCH common 3/3] upid: fix calls to decode function Thomas Lamprecht
2025-10-01 11:17 ` Fiona Ebner
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=20251001093750.51078-4-f.ebner@proxmox.com \
--to=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.