[pve-devel] [PATCH v4 pve-container 1/5] Ensure that container startup warnings are displayed if startup fails.

Robert Obkircher r.obkircher at proxmox.com
Thu Nov 13 16:02:59 CET 2025


During container startup, warnings are written to a file, which is
later logged to the RESTEnvironment. This should also happen in the
presence of errors, so move it outside the eval block.

Signed-off-by: Robert Obkircher <r.obkircher at proxmox.com>
---
 src/PVE/LXC.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 89ccb54..44e20bc 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -2976,10 +2976,12 @@ sub vm_start {
 
         # if debug is requested, print the log it also when the start succeeded
         print_ct_stderr_log($vmid) if $is_debug;
-
+    };
+    my $err = $@;
+    eval {
         print_ct_warn_log($vmid); # always print warn log, if any
     };
-    if (my $err = $@) {
+    if ($err) {
         unlink $skiplock_flag_fn;
         die $err;
     }
-- 
2.47.3





More information about the pve-devel mailing list