* [PATCH container v2] lxc: remove unused find_lxc_console_pids helper
@ 2026-10-19 9:11 Filip Schauer
2026-10-20 8:38 ` Elias Huhsovitz
0 siblings, 1 reply; 2+ messages in thread
From: Filip Schauer @ 2026-10-19 9:11 UTC (permalink / raw)
To: pve-devel
The helper is no longer needed, as its only user was the stale LXC
console reaper in pve-manager, which was removed in
888c136dd303 ("fix #8093: pvestatd: remove stale lxc console reaper").
Drop the now dead code, and add a versioned Breaks against pve-manager
(<< 9.2.22) to prevent pvestatd from crashing with an undefined
subroutine error during partial upgrades.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
debian/control | 1 +
src/PVE/LXC.pm | 30 ------------------------------
2 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/debian/control b/debian/control
index ef57b13..1d77c38 100644
--- a/debian/control
+++ b/debian/control
@@ -41,5 +41,6 @@ Depends: binutils,
xz-utils,
${misc:Depends},
${perl:Depends},
+Breaks: pve-manager (<< 9.2.22),
Description: Proxmox VE Container management tool
Tool to manage Linux Containers on Proxmox VE.
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index e2e6ff6..785e547 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -409,36 +409,6 @@ sub vmstatus {
return $list;
}
-sub find_lxc_console_pids {
-
- my $res = {};
-
- PVE::Tools::dir_glob_foreach(
- '/proc',
- '\d+',
- sub {
- my ($pid) = @_;
-
- my $cmdline = PVE::Tools::file_read_firstline("/proc/$pid/cmdline");
- return if !$cmdline;
-
- my @args = split(/\0/, $cmdline);
-
- # search for lxc-console -n <vmid>
- return if scalar(@args) != 3;
- return if $args[1] ne '-n';
- return if $args[2] !~ m/^\d+$/;
- return if $args[0] !~ m|^(/usr/bin/)?lxc-console$|;
-
- my $vmid = $args[2];
-
- push @{ $res->{$vmid} }, $pid;
- },
- );
-
- return $res;
-}
-
sub find_lxc_pid {
my ($vmid) = @_;
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH container v2] lxc: remove unused find_lxc_console_pids helper
2026-10-19 9:11 [PATCH container v2] lxc: remove unused find_lxc_console_pids helper Filip Schauer
@ 2026-10-20 8:38 ` Elias Huhsovitz
0 siblings, 0 replies; 2+ messages in thread
From: Elias Huhsovitz @ 2026-10-20 8:38 UTC (permalink / raw)
To: Filip Schauer, pve-devel
Was unable to find this subroutine used anywhere.
Also gave this a quick test and basic container usage did not throw any
"undefined subroutine" errors.
LGTM!
Reviewed-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
Tested-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
On Mon Oct 19, 2026 at 11:11 AM CEST, Filip Schauer wrote:
> The helper is no longer needed, as its only user was the stale LXC
> console reaper in pve-manager, which was removed in
> 888c136dd303 ("fix #8093: pvestatd: remove stale lxc console reaper").
>
> Drop the now dead code, and add a versioned Breaks against pve-manager
> (<< 9.2.22) to prevent pvestatd from crashing with an undefined
> subroutine error during partial upgrades.
>
> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
> ---
> debian/control | 1 +
> src/PVE/LXC.pm | 30 ------------------------------
> 2 files changed, 1 insertion(+), 30 deletions(-)
>
> diff --git a/debian/control b/debian/control
> index ef57b13..1d77c38 100644
> --- a/debian/control
> +++ b/debian/control
> @@ -41,5 +41,6 @@ Depends: binutils,
> xz-utils,
> ${misc:Depends},
> ${perl:Depends},
> +Breaks: pve-manager (<< 9.2.22),
> Description: Proxmox VE Container management tool
> Tool to manage Linux Containers on Proxmox VE.
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index e2e6ff6..785e547 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -409,36 +409,6 @@ sub vmstatus {
> return $list;
> }
>
> -sub find_lxc_console_pids {
> -
> - my $res = {};
> -
> - PVE::Tools::dir_glob_foreach(
> - '/proc',
> - '\d+',
> - sub {
> - my ($pid) = @_;
> -
> - my $cmdline = PVE::Tools::file_read_firstline("/proc/$pid/cmdline");
> - return if !$cmdline;
> -
> - my @args = split(/\0/, $cmdline);
> -
> - # search for lxc-console -n <vmid>
> - return if scalar(@args) != 3;
> - return if $args[1] ne '-n';
> - return if $args[2] !~ m/^\d+$/;
> - return if $args[0] !~ m|^(/usr/bin/)?lxc-console$|;
> -
> - my $vmid = $args[2];
> -
> - push @{ $res->{$vmid} }, $pid;
> - },
> - );
> -
> - return $res;
> -}
> -
> sub find_lxc_pid {
> my ($vmid) = @_;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-20 8:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 9:11 [PATCH container v2] lxc: remove unused find_lxc_console_pids helper Filip Schauer
2026-10-20 8:38 ` Elias Huhsovitz
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.