From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server] qmeventd: also treat 'prelaunch' and 'suspended' states as active
Date: Tue, 10 Oct 2023 10:57:03 +0200 [thread overview]
Message-ID: <20231010085703.27139-1-f.ebner@proxmox.com> (raw)
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@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
next reply other threads:[~2023-10-10 8:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 8:57 Fiona Ebner [this message]
2024-01-16 12:22 ` Fiona Ebner
2024-04-23 14:47 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231010085703.27139-1-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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