all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs
@ 2026-02-06 12:45 Daniel Kral
  2026-02-06 12:45 ` [PATCH container v2 1/4] setup: plugin: add missing check_systemd_nesting stub Daniel Kral
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Daniel Kral @ 2026-02-06 12:45 UTC (permalink / raw)
  To: pve-devel

changes from v1:
  - add missing check_systemd_nesting to Plugin.pm
  - adapt patch message regarding the protected_call(...)
  - preprend 'fix #7270' in patch summary


Small fixes, which add missing no-op methods for unmanaged containers,
where the first fixes unmanaged containers to start again and be able to
create/clone unmanaged containers, while the latter is only removing an
error message.

Tested with an unmanaged voidlinux container.

Daniel Kral (4):
  setup: plugin: add missing check_systemd_nesting stub
  fix #7270: setup: add no-op check_systemd_nesting for unmanaged CTs
  setup: add no-op detect_architecture for unmanaged CTs
  setup: make the architecture fall back to amd64 for falsy values

 src/PVE/LXC/Setup.pm           |  2 +-
 src/PVE/LXC/Setup/Plugin.pm    |  5 +++++
 src/PVE/LXC/Setup/Unmanaged.pm | 13 ++++++++++++-
 3 files changed, 18 insertions(+), 2 deletions(-)

-- 
2.47.3





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

* [PATCH container v2 1/4] setup: plugin: add missing check_systemd_nesting stub
  2026-02-06 12:45 [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Daniel Kral
@ 2026-02-06 12:45 ` Daniel Kral
  2026-02-06 12:45 ` [PATCH container v2 2/4] fix #7270: setup: add no-op check_systemd_nesting for unmanaged CTs Daniel Kral
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Daniel Kral @ 2026-02-06 12:45 UTC (permalink / raw)
  To: pve-devel

Suggested-by: Robert Obkircher <r.obkircher@proxmox.com>
Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
changes from v1:
  - new!

 src/PVE/LXC/Setup/Plugin.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PVE/LXC/Setup/Plugin.pm b/src/PVE/LXC/Setup/Plugin.pm
index fbcfa8e..cb8e5c4 100644
--- a/src/PVE/LXC/Setup/Plugin.pm
+++ b/src/PVE/LXC/Setup/Plugin.pm
@@ -57,6 +57,11 @@ sub get_ct_init_path {
     croak "implement me in sub-class\n";
 }
 
+sub check_systemd_nesting {
+    my ($self) = @_;
+    croak "implement me in sub-class\n";
+}
+
 sub ssh_host_key_types_to_generate {
     my ($self) = @_;
     croak "implement me in sub-class\n";
-- 
2.47.3





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

* [PATCH container v2 2/4] fix #7270: setup: add no-op check_systemd_nesting for unmanaged CTs
  2026-02-06 12:45 [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Daniel Kral
  2026-02-06 12:45 ` [PATCH container v2 1/4] setup: plugin: add missing check_systemd_nesting stub Daniel Kral
@ 2026-02-06 12:45 ` Daniel Kral
  2026-02-06 12:45 ` [PATCH container v2 3/4] setup: add no-op detect_architecture " Daniel Kral
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Daniel Kral @ 2026-02-06 12:45 UTC (permalink / raw)
  To: pve-devel

Otherwise the container will fail to start, create and clone, because
the plugin's check_systemd_nesting is only defined in the Base module
but not the Unmanaged module and is called in the pre_start_hook,
post_clone_hook, and post_create_hook.

Reported in the Proxmox Forum [0].

[0] https://forum.proxmox.com/threads/180258/

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
changes from v1:
  - preprend 'fix #7270' in patch summary

 src/PVE/LXC/Setup/Unmanaged.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Setup/Unmanaged.pm b/src/PVE/LXC/Setup/Unmanaged.pm
index d76921e..aa26c1c 100644
--- a/src/PVE/LXC/Setup/Unmanaged.pm
+++ b/src/PVE/LXC/Setup/Unmanaged.pm
@@ -51,7 +51,13 @@ sub unified_cgroupv2_support {
 
 sub get_ct_init_path {
     my ($self) = @_;
-    return '/sbin/init'; # only passed to unified_cgroupv2_support for now
+    # only passed to check_systemd_nesting and unified_cgroupv2_support for now
+    return '/sbin/init';
+}
+
+sub check_systemd_nesting {
+    my ($self, $conf, $init) = @_;
+    return;
 }
 
 sub ssh_host_key_types_to_generate {
-- 
2.47.3





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

* [PATCH container v2 3/4] setup: add no-op detect_architecture for unmanaged CTs
  2026-02-06 12:45 [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Daniel Kral
  2026-02-06 12:45 ` [PATCH container v2 1/4] setup: plugin: add missing check_systemd_nesting stub Daniel Kral
  2026-02-06 12:45 ` [PATCH container v2 2/4] fix #7270: setup: add no-op check_systemd_nesting for unmanaged CTs Daniel Kral
@ 2026-02-06 12:45 ` Daniel Kral
  2026-02-06 13:09   ` Fiona Ebner
  2026-02-06 14:30   ` applied: " Thomas Lamprecht
  2026-02-06 12:45 ` [PATCH container v2 4/4] setup: make the architecture fall back to amd64 for falsy values Daniel Kral
  2026-02-06 13:18 ` partially-applied: [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Fiona Ebner
  4 siblings, 2 replies; 11+ messages in thread
From: Daniel Kral @ 2026-02-06 12:45 UTC (permalink / raw)
  To: pve-devel

This plugin method is only called in PVE::LXC::Setup::new() and is
wrapped in an eval block, so it won't fail to create the container, but
report an error that the plugin method is not implemented for unmanaged
containers.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
changes from v1:
  - none

 src/PVE/LXC/Setup/Unmanaged.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PVE/LXC/Setup/Unmanaged.pm b/src/PVE/LXC/Setup/Unmanaged.pm
index aa26c1c..b51be55 100644
--- a/src/PVE/LXC/Setup/Unmanaged.pm
+++ b/src/PVE/LXC/Setup/Unmanaged.pm
@@ -65,6 +65,11 @@ sub ssh_host_key_types_to_generate {
     return;
 }
 
+sub detect_architecture {
+    my ($self) = @_;
+    return;
+}
+
 # hooks
 
 sub pre_start_hook {
-- 
2.47.3





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

* [PATCH container v2 4/4] setup: make the architecture fall back to amd64 for falsy values
  2026-02-06 12:45 [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Daniel Kral
                   ` (2 preceding siblings ...)
  2026-02-06 12:45 ` [PATCH container v2 3/4] setup: add no-op detect_architecture " Daniel Kral
@ 2026-02-06 12:45 ` Daniel Kral
  2026-02-06 14:30   ` applied: " Thomas Lamprecht
  2026-02-06 13:18 ` partially-applied: [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Fiona Ebner
  4 siblings, 1 reply; 11+ messages in thread
From: Daniel Kral @ 2026-02-06 12:45 UTC (permalink / raw)
  To: pve-devel

The architecture fallback branch relied on detect_architecture(...)
failing and therefore $arch being undef afterwards.

However, if protected_call(sub { detect_architecture(...) }) itself
returns a defined, falsy value, such as a empty string converted from an
undef value, the 'arch' field will be set to that value, which will make
the container fail to start.

Therefore, fallback to 'amd64' for any falsy $arch value.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
changes from v1:
  - adapt patch message regarding the protected_call(...)

 src/PVE/LXC/Setup.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
index 113093d..fb0207e 100644
--- a/src/PVE/LXC/Setup.pm
+++ b/src/PVE/LXC/Setup.pm
@@ -153,7 +153,7 @@ sub new {
             warn "Architecture detection failed: $err" if $err;
         }
 
-        if (!defined($arch)) {
+        if (!$arch) {
             $arch = 'amd64';
             print "Falling back to $arch.\nUse `pct set VMID --arch ARCH` to change.\n";
         } else {
-- 
2.47.3





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

* Re: [PATCH container v2 3/4] setup: add no-op detect_architecture for unmanaged CTs
  2026-02-06 12:45 ` [PATCH container v2 3/4] setup: add no-op detect_architecture " Daniel Kral
@ 2026-02-06 13:09   ` Fiona Ebner
  2026-02-06 14:30     ` Thomas Lamprecht
  2026-02-06 14:30   ` applied: " Thomas Lamprecht
  1 sibling, 1 reply; 11+ messages in thread
From: Fiona Ebner @ 2026-02-06 13:09 UTC (permalink / raw)
  To: Daniel Kral, pve-devel

Am 06.02.26 um 1:44 PM schrieb Daniel Kral:
> This plugin method is only called in PVE::LXC::Setup::new() and is
> wrapped in an eval block, so it won't fail to create the container, but
> report an error that the plugin method is not implemented for unmanaged
> containers.
> 
> Signed-off-by: Daniel Kral <d.kral@proxmox.com>
> ---
> changes from v1:
>   - none
> 
>  src/PVE/LXC/Setup/Unmanaged.pm | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/PVE/LXC/Setup/Unmanaged.pm b/src/PVE/LXC/Setup/Unmanaged.pm
> index aa26c1c..b51be55 100644
> --- a/src/PVE/LXC/Setup/Unmanaged.pm
> +++ b/src/PVE/LXC/Setup/Unmanaged.pm
> @@ -65,6 +65,11 @@ sub ssh_host_key_types_to_generate {
>      return;
>  }
>  
> +sub detect_architecture {
> +    my ($self) = @_;
> +    return;

Thinking through it again, should we rather just die here instead of
returning undef? It seems to me that the contract for the method is
currently "either return the detected architecture or die". Then patch
4/4 would not be needed. Your new implementation adds a "or return
undef" to the contract making it more complicated.

> +}
> +
>  # hooks
>  
>  sub pre_start_hook {





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

* partially-applied: [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs
  2026-02-06 12:45 [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Daniel Kral
                   ` (3 preceding siblings ...)
  2026-02-06 12:45 ` [PATCH container v2 4/4] setup: make the architecture fall back to amd64 for falsy values Daniel Kral
@ 2026-02-06 13:18 ` Fiona Ebner
  4 siblings, 0 replies; 11+ messages in thread
From: Fiona Ebner @ 2026-02-06 13:18 UTC (permalink / raw)
  To: pve-devel, Daniel Kral

On Fri, 06 Feb 2026 13:45:01 +0100, Daniel Kral wrote:
> changes from v1:
>   - add missing check_systemd_nesting to Plugin.pm
>   - adapt patch message regarding the protected_call(...)
>   - preprend 'fix #7270' in patch summary
> 
> 
> Small fixes, which add missing no-op methods for unmanaged containers,
> where the first fixes unmanaged containers to start again and be able to
> create/clone unmanaged containers, while the latter is only removing an
> error message.
> 
> [...]

Applied the first two patches already, thanks! Squashed in a change to
use the full argument list rather than just $self for the stub in
patch 1/4.

[1/4] setup: plugin: add missing check_systemd_nesting stub
      commit: 1b3f2a230f96ffff626dd1ecebd13461b11bd0b0
[2/4] fix #7270: setup: add no-op check_systemd_nesting for unmanaged CTs
      commit: 68c7cd45d1a15bde52ee8e0f4fb238e5576a527b




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

* Re: [PATCH container v2 3/4] setup: add no-op detect_architecture for unmanaged CTs
  2026-02-06 13:09   ` Fiona Ebner
@ 2026-02-06 14:30     ` Thomas Lamprecht
  2026-02-06 15:04       ` Fiona Ebner
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Lamprecht @ 2026-02-06 14:30 UTC (permalink / raw)
  To: Fiona Ebner, Daniel Kral, pve-devel

Am 06.02.26 um 14:08 schrieb Fiona Ebner:
>> +sub detect_architecture {
>> +    my ($self) = @_;
>> +    return;
> Thinking through it again, should we rather just die here instead of
> returning undef? It seems to me that the contract for the method is
> currently "either return the detected architecture or die". Then patch

That description of the contract is not correct, for normal os types
it fails if the arch could not be detected, for unmanaged this should
not be the case, as we never can detect it there by design, and returning
undef is more correct as of now.

> 4/4 would not be needed. Your new implementation adds a "or return
> undef" to the contract making it more complicated.





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

* applied: [PATCH container v2 3/4] setup: add no-op detect_architecture for unmanaged CTs
  2026-02-06 12:45 ` [PATCH container v2 3/4] setup: add no-op detect_architecture " Daniel Kral
  2026-02-06 13:09   ` Fiona Ebner
@ 2026-02-06 14:30   ` Thomas Lamprecht
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Lamprecht @ 2026-02-06 14:30 UTC (permalink / raw)
  To: pve-devel, Daniel Kral

On Fri, 06 Feb 2026 13:45:04 +0100, Daniel Kral wrote:
> This plugin method is only called in PVE::LXC::Setup::new() and is
> wrapped in an eval block, so it won't fail to create the container, but
> report an error that the plugin method is not implemented for unmanaged
> containers.
> 
> 

Applied but re-ordered this after the next patch, as it cannot really work
without the change of 4/4, thanks!

[3/4] setup: add no-op detect_architecture for unmanaged CTs
      commit: 0704ca34c1bb73edcf61bb9aaf22d955cc2cf28b




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

* applied: [PATCH container v2 4/4] setup: make the architecture fall back to amd64 for falsy values
  2026-02-06 12:45 ` [PATCH container v2 4/4] setup: make the architecture fall back to amd64 for falsy values Daniel Kral
@ 2026-02-06 14:30   ` Thomas Lamprecht
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Lamprecht @ 2026-02-06 14:30 UTC (permalink / raw)
  To: pve-devel, Daniel Kral

On Fri, 06 Feb 2026 13:45:05 +0100, Daniel Kral wrote:
> The architecture fallback branch relied on detect_architecture(...)
> failing and therefore $arch being undef afterwards.
> 
> However, if protected_call(sub { detect_architecture(...) }) itself
> returns a defined, falsy value, such as a empty string converted from an
> undef value, the 'arch' field will be set to that value, which will make
> the container fail to start.
> 
> [...]

Applied, but as mentioned in my reply to 3/4 I ordered this earlier, as it's a
prerequisite for this patch, thanks!

[4/4] setup: make the architecture fall back to amd64 for falsy values
      commit: e21afdcea18be498a7a4cebf6ad2df42ddfb9caf




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

* Re: [PATCH container v2 3/4] setup: add no-op detect_architecture for unmanaged CTs
  2026-02-06 14:30     ` Thomas Lamprecht
@ 2026-02-06 15:04       ` Fiona Ebner
  0 siblings, 0 replies; 11+ messages in thread
From: Fiona Ebner @ 2026-02-06 15:04 UTC (permalink / raw)
  To: Thomas Lamprecht, Daniel Kral, pve-devel

Am 06.02.26 um 3:28 PM schrieb Thomas Lamprecht:
> Am 06.02.26 um 14:08 schrieb Fiona Ebner:
>>> +sub detect_architecture {
>>> +    my ($self) = @_;
>>> +    return;
>> Thinking through it again, should we rather just die here instead of
>> returning undef? It seems to me that the contract for the method is
>> currently "either return the detected architecture or die". Then patch
> 
> That description of the contract is not correct, for normal os types
> it fails if the arch could not be detected, for unmanaged this should
> not be the case, as we never can detect it there by design, and returning
> undef is more correct as of now.

Since there is no documentation, I took 'contract' to be "the current
behavior and expectation of the use sites". But changing this is fine by
me too.

> 
>> 4/4 would not be needed. Your new implementation adds a "or return
>> undef" to the contract making it more complicated.
> 





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

end of thread, other threads:[~2026-02-06 15:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-06 12:45 [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Daniel Kral
2026-02-06 12:45 ` [PATCH container v2 1/4] setup: plugin: add missing check_systemd_nesting stub Daniel Kral
2026-02-06 12:45 ` [PATCH container v2 2/4] fix #7270: setup: add no-op check_systemd_nesting for unmanaged CTs Daniel Kral
2026-02-06 12:45 ` [PATCH container v2 3/4] setup: add no-op detect_architecture " Daniel Kral
2026-02-06 13:09   ` Fiona Ebner
2026-02-06 14:30     ` Thomas Lamprecht
2026-02-06 15:04       ` Fiona Ebner
2026-02-06 14:30   ` applied: " Thomas Lamprecht
2026-02-06 12:45 ` [PATCH container v2 4/4] setup: make the architecture fall back to amd64 for falsy values Daniel Kral
2026-02-06 14:30   ` applied: " Thomas Lamprecht
2026-02-06 13:18 ` partially-applied: [PATCH-SERIES container v2 0/4] add missing no-op methods for unmanaged CTs Fiona Ebner

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal