From 7ba974a6828d6d8ec20616bc48551cf226854f31 Mon Sep 17 00:00:00 2001 From: Filip Schauer Date: Mon, 9 Oct 2023 15:25:19 +0200 Subject: [PATCH] Fix ACPI-suspended VMs resuming after migration Add checks for "suspended" and "prelaunch" runstates when checking whether a VM is paused. This fixes the following issues: * ACPI-suspended VMs automatically resuming after migration * Shutdown and reboot commands timing out instead of failing immediately on suspended VMs Signed-off-by: Filip Schauer --- PVE/QemuServer.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 1b1ccf4d..28956755 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -8503,7 +8503,11 @@ sub vm_is_paused { mon_cmd($vmid, "query-status"); }; warn "$@\n" if $@; - return $qmpstatus && $qmpstatus->{status} eq "paused"; + return $qmpstatus && ( + $qmpstatus->{status} eq "paused" || + $qmpstatus->{status} eq "suspended" || + $qmpstatus->{status} eq "prelaunch" + ); } sub check_volume_storage_type {