From 81a8c4e5ee44af91dc283bc5ebf4760f0b8b8a51 Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Tue, 10 Oct 2023 10:57:03 +0200 Subject: [PATCH] qmeventd: also treat 'prelaunch' and 'suspended' states as active 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 --- 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) {