From c799e40fbf7724a2d4558deb25f35e829d51d5ce Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Tue, 14 May 2024 16:11:13 +0200 Subject: [PATCH] suspend: continue cleanup even if savevm-end QMP command fails The savevm-end command also fails when no snapshot operation was started before. In particular, this is the case when savevm-start failed early, because of unmigratable devices. Avoid potentially leaving an orphaned volume and snasphot-related configuration keys around by continuing with cleanup instead. Signed-off-by: Fiona Ebner --- PVE/QemuServer.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 9032d294..5df0c96d 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -6406,7 +6406,8 @@ sub vm_suspend { if ($err) { # cleanup, but leave suspending lock, to indicate something went wrong eval { - mon_cmd($vmid, "savevm-end"); + eval { mon_cmd($vmid, "savevm-end"); }; + warn $@ if $@; PVE::Storage::deactivate_volumes($storecfg, [$vmstate]); PVE::Storage::vdisk_free($storecfg, $vmstate); delete $conf->@{qw(vmstate runningmachine runningcpu)};