all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v3 qemu-server] Fix ACPI-suspended VMs resuming after migration
@ 2023-10-09 13:25 Filip Schauer
  2023-10-10  8:58 ` [pve-devel] applied: " Fiona Ebner
  2023-10-10 11:45 ` [pve-devel] " Thomas Lamprecht
  0 siblings, 2 replies; 5+ messages in thread
From: Filip Schauer @ 2023-10-09 13:25 UTC (permalink / raw)
  To: pve-devel

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 <f.schauer@proxmox.com>
---
Changes since v2:
* Make && and || operators consistent
* Revert rename vm_is_paused to vm_is_frozen

We could have renamed vm_is_paused to vcpus_are_paused, but I do not
consider that necessary.

 PVE/QemuServer.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 1b1ccf4..2895675 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 {
-- 
2.39.2





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-11  7:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-09 13:25 [pve-devel] [PATCH v3 qemu-server] Fix ACPI-suspended VMs resuming after migration Filip Schauer
2023-10-10  8:58 ` [pve-devel] applied: " Fiona Ebner
2023-10-10 11:45 ` [pve-devel] " Thomas Lamprecht
2023-10-10 14:19   ` Fiona Ebner
2023-10-11  7:38     ` Fiona Ebner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal