[pve-devel] [PATCH qemu-server] qmeventd: also treat 'prelaunch' and 'suspended' states as active

Fiona Ebner f.ebner at proxmox.com
Tue Oct 10 10:57:03 CEST 2023


Otherwise, a VM in those states would be terminated after a backup
in handle_qmp_return() with QMP 'quit', which is pretty bad in case
of the 'suspended' state.

Does not change the fact that a VM started in prelaunch mode for
backup is terminated later (that is handled by the Perl code).

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 qmeventd/qmeventd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/qmeventd/qmeventd.c b/qmeventd/qmeventd.c
index 002b2ac4..d8f3ee72 100644
--- a/qmeventd/qmeventd.c
+++ b/qmeventd/qmeventd.c
@@ -272,8 +272,12 @@ handle_qmp_return(struct Client *client, struct json_object *data, bool error)
     bool active = false;
     if (has_status) {
 	const char *status_str = json_object_get_string(status);
-	active = status_str &&
-	    (!strcmp(status_str, "running") || !strcmp(status_str, "paused"));
+	active = status_str && (
+	    !strcmp(status_str, "running")
+	    || !strcmp(status_str, "paused")
+	    || !strcmp(status_str, "suspended")
+	    || !strcmp(status_str, "prelaunch")
+	);
     }
 
     switch (client->state) {
-- 
2.39.2






More information about the pve-devel mailing list