[pve-devel] [PATCH common 3/3] upid: fix calls to decode function
Fiona Ebner
f.ebner at proxmox.com
Wed Oct 1 11:36:42 CEST 2025
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 at 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
More information about the pve-devel
mailing list