5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-03 01:17:58 +03:00

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 <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2023-10-10 10:57:03 +02:00 committed by Thomas Lamprecht
parent 6ba1f1c0c3
commit 81a8c4e5ee

View File

@ -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) {