aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-01-03 12:05:32 -0800
committerPeter Xu <peterx@redhat.com>2024-01-04 09:52:42 +0800
commit0f1db069b6c5e7f7ddcdcc9c64fd4b6dbe4afcdf (patch)
tree4d3d938503ae964c4551e2a8b57f2b7e84427826 /hw/usb
parentb9ae473d80302519a7b89f98795a80abfea1deea (diff)
downloadqemu-0f1db069b6c5e7f7ddcdcc9c64fd4b6dbe4afcdf.zip
qemu-0f1db069b6c5e7f7ddcdcc9c64fd4b6dbe4afcdf.tar.gz
qemu-0f1db069b6c5e7f7ddcdcc9c64fd4b6dbe4afcdf.tar.bz2
cpus: check running not RUN_STATE_RUNNING
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: https://lore.kernel.org/r/1704312341-66640-4-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/hcd-ehci.c2
-rw-r--r--hw/usb/redirect.c2
2 files changed, 2 insertions, 2 deletions
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 */
}
}