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 <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2024-05-14 16:11:13 +02:00 committed by Thomas Lamprecht
parent 88e18f9c5d
commit c799e40fbf

View File

@ -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)};