[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V8 03/12] cpus: check running not RUN_STATE_RUNNING
From: |
Steve Sistare |
Subject: |
[PATCH V8 03/12] cpus: check running not RUN_STATE_RUNNING |
Date: |
Wed, 13 Dec 2023 07:30:12 -0800 |
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>
---
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 f7f1b4a..254fce7 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 19b4534..10c82ce 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 c9893df..3785bb0 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 565dc39..47e6cb1 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)
--
1.8.3.1
- [PATCH V8 00/12] fix migration of suspended runstate, Steve Sistare, 2023/12/13
- [PATCH V8 05/12] migration: propagate suspended runstate, Steve Sistare, 2023/12/13
- [PATCH V8 01/12] cpus: vm_was_suspended, Steve Sistare, 2023/12/13
- [PATCH V8 07/12] migration: preserve suspended for snapshot, Steve Sistare, 2023/12/13
- [PATCH V8 06/12] migration: preserve suspended runstate, Steve Sistare, 2023/12/13
- [PATCH V8 09/12] tests/qtest: migration events, Steve Sistare, 2023/12/13
- [PATCH V8 03/12] cpus: check running not RUN_STATE_RUNNING,
Steve Sistare <=
- [PATCH V8 08/12] migration: preserve suspended for bg_migration, Steve Sistare, 2023/12/13
- [PATCH V8 02/12] cpus: stop vm in suspended runstate, Steve Sistare, 2023/12/13
- [PATCH V8 12/12] tests/qtest: postcopy migration with suspend, Steve Sistare, 2023/12/13
- [PATCH V8 11/12] tests/qtest: precopy migration with suspend, Steve Sistare, 2023/12/13
- [PATCH V8 04/12] cpus: vm_resume, Steve Sistare, 2023/12/13
- [PATCH V8 10/12] tests/qtest: option to suspend during migration, Steve Sistare, 2023/12/13
- Re: [PATCH V8 00/12] fix migration of suspended runstate, Steven Sistare, 2023/12/13