[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/26] cpus: check running not RUN_STATE_RUNNING
From: |
peterx |
Subject: |
[PULL 05/26] cpus: check running not RUN_STATE_RUNNING |
Date: |
Thu, 4 Jan 2024 12:31:50 +0800 |
From: Steve Sistare <steven.sistare@oracle.com>
When a vm transitions from running to suspended, runstate notifiers are
not called, so the notifiers still think the vm is running. Hence, when
we call vm_start to restore the suspended state, we call vm_state_notify
with running=1. However, some notifiers check for RUN_STATE_RUNNING.
They must check the running boolean instead.
No functional change.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link:
1704312341-66640-4-git-send-email-steven.sistare@oracle.com">https://lore.kernel.org/r/1704312341-66640-4-git-send-email-steven.sistare@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
---
backends/tpm/tpm_emulator.c | 2 +-
hw/usb/hcd-ehci.c | 2 +-
hw/usb/redirect.c | 2 +-
hw/xen/xen-hvm-common.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/backends/tpm/tpm_emulator.c b/backends/tpm/tpm_emulator.c
index f7f1b4ad7a..254fce7764 100644
--- a/backends/tpm/tpm_emulator.c
+++ b/backends/tpm/tpm_emulator.c
@@ -904,7 +904,7 @@ static void tpm_emulator_vm_state_change(void *opaque, bool
running,
trace_tpm_emulator_vm_state_change(running, state);
- if (!running || state != RUN_STATE_RUNNING || !tpm_emu->relock_storage) {
+ if (!running || !tpm_emu->relock_storage) {
return;
}
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 19b4534c20..10c82ce472 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2451,7 +2451,7 @@ static void usb_ehci_vm_state_change(void *opaque, bool
running, RunState state)
* USB-devices which have async handled packages have a packet in the
* ep queue to match the completion with.
*/
- if (state == RUN_STATE_RUNNING) {
+ if (running) {
ehci_advance_async_state(ehci);
}
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index c9893df867..3785bb057b 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -1403,7 +1403,7 @@ static void usbredir_vm_state_change(void *priv, bool
running, RunState state)
{
USBRedirDevice *dev = priv;
- if (state == RUN_STATE_RUNNING && dev->parser != NULL) {
+ if (running && dev->parser != NULL) {
usbredirparser_do_write(dev->parser); /* Flush any pending writes */
}
}
diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index 565dc39c8f..47e6cb1db3 100644
--- a/hw/xen/xen-hvm-common.c
+++ b/hw/xen/xen-hvm-common.c
@@ -623,7 +623,7 @@ void xen_hvm_change_state_handler(void *opaque, bool
running,
xen_set_ioreq_server_state(xen_domid,
state->ioservid,
- (rstate == RUN_STATE_RUNNING));
+ running);
}
void xen_exit_notifier(Notifier *n, void *data)
--
2.41.0
- [PULL 00/26] Migration 20240104 patches, peterx, 2024/01/03
- [PULL 01/26] MAINTAINERS: Leaving Migration, peterx, 2024/01/03
- [PULL 02/26] MAINTAINERS: Remove myself as reviewer from Live Migration, peterx, 2024/01/03
- [PULL 03/26] cpus: vm_was_suspended, peterx, 2024/01/03
- [PULL 04/26] cpus: stop vm in suspended runstate, peterx, 2024/01/03
- [PULL 05/26] cpus: check running not RUN_STATE_RUNNING,
peterx <=
- [PULL 06/26] cpus: vm_resume, peterx, 2024/01/03
- [PULL 07/26] migration: propagate suspended runstate, peterx, 2024/01/03
- [PULL 08/26] migration: preserve suspended runstate, peterx, 2024/01/03
- [PULL 09/26] migration: preserve suspended for snapshot, peterx, 2024/01/03
- [PULL 10/26] migration: preserve suspended for bg_migration, peterx, 2024/01/03
- [PULL 11/26] tests/qtest: migration events, peterx, 2024/01/03
- [PULL 12/26] tests/qtest: option to suspend during migration, peterx, 2024/01/03
- [PULL 13/26] tests/qtest: precopy migration with suspend, peterx, 2024/01/03
- [PULL 14/26] tests/qtest: postcopy migration with suspend, peterx, 2024/01/03
- [PULL 15/26] migration: Remove migrate_max_downtime() declaration, peterx, 2024/01/03