[pve-devel] [PATCH qemu-server] suspend: continue cleanup even if savevm-end QMP command fails
Fiona Ebner
f.ebner at proxmox.com
Tue May 14 16:11:13 CEST 2024
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 at proxmox.com>
---
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)};
--
2.39.2
More information about the pve-devel
mailing list