[pve-devel] applied: [PATCH container] stop/reboot: handle pending changes errors as non-fatal

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 22 10:02:04 CET 2019


Note them in the log, but do not die - the pending changes should be
kept if the did not apply and we do not want to cancel a reboot.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/lxc-pve-poststop-hook | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc-pve-poststop-hook b/src/lxc-pve-poststop-hook
index 64fe54d..438836c 100755
--- a/src/lxc-pve-poststop-hook
+++ b/src/lxc-pve-poststop-hook
@@ -40,7 +40,8 @@ PVE::LXC::Tools::lxc_hook('post-stop', 'lxc', sub {
 
     my $config_updated = 0;
     if ($conf->{pending}) {
-	PVE::LXC::Config->vmconfig_apply_pending($vmid, $conf, $storage_cfg);
+	eval { PVE::LXC::Config->vmconfig_apply_pending($vmid, $conf, $storage_cfg) };
+	warn "$@" if $@;
 	PVE::LXC::update_lxc_config($vmid, $conf);
 	$config_updated = 1;
     }
-- 
2.20.1





More information about the pve-devel mailing list