From: Steve Sistare <steven.sistare@oracle.com>
To: qemu-devel@nongnu.org
Cc: "Juan Quintela" <quintela@redhat.com>,
"Peter Xu" <peterx@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Leonardo Bras" <leobras@redhat.com>,
"Steve Sistare" <steven.sistare@oracle.com>
Subject: [PATCH V7 03/12] cpus: check running not RUN_STATE_RUNNING
Date: Wed, 6 Dec 2023 09:23:28 -0800 [thread overview]
Message-ID: <1701883417-356268-4-git-send-email-steven.sistare@oracle.com> (raw)
In-Reply-To: <1701883417-356268-1-git-send-email-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>
---
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
next prev parent reply other threads:[~2023-12-06 17:24 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 17:23 [PATCH V7 00/12] fix migration of suspended runstate Steve Sistare
2023-12-06 17:23 ` [PATCH V7 01/12] cpus: vm_was_suspended Steve Sistare
2023-12-06 17:23 ` [PATCH V7 02/12] cpus: stop vm in suspended runstate Steve Sistare
2023-12-06 18:45 ` Philippe Mathieu-Daudé
2023-12-06 19:19 ` Steven Sistare
2023-12-06 20:48 ` Philippe Mathieu-Daudé
2023-12-06 21:09 ` Philippe Mathieu-Daudé
2023-12-11 6:25 ` Peter Xu
2023-12-11 13:37 ` Steven Sistare
2023-12-06 17:23 ` Steve Sistare [this message]
2023-12-06 17:23 ` [PATCH V7 04/12] cpus: vm_resume Steve Sistare
2023-12-06 17:23 ` [PATCH V7 05/12] migration: propagate suspended runstate Steve Sistare
2023-12-08 16:37 ` Fabiano Rosas
2023-12-08 17:28 ` Steven Sistare
2023-12-11 6:46 ` Peter Xu
2023-12-11 13:23 ` Steven Sistare
2023-12-06 17:23 ` [PATCH V7 06/12] migration: preserve " Steve Sistare
2023-12-06 17:23 ` [PATCH V7 07/12] migration: preserve suspended for snapshot Steve Sistare
2023-12-06 17:23 ` [PATCH V7 08/12] migration: preserve suspended for bg_migration Steve Sistare
2023-12-06 17:23 ` [PATCH V7 09/12] tests/qtest: migration events Steve Sistare
2023-12-06 17:23 ` [PATCH V7 10/12] tests/qtest: option to suspend during migration Steve Sistare
2023-12-06 17:23 ` [PATCH V7 11/12] tests/qtest: precopy migration with suspend Steve Sistare
2023-12-08 16:37 ` Fabiano Rosas
2023-12-11 6:54 ` Peter Xu
2023-12-06 17:23 ` [PATCH V7 12/12] tests/qtest: postcopy " Steve Sistare
2023-12-11 6:54 ` Peter Xu
2023-12-06 17:30 ` [PATCH V7 00/12] fix migration of suspended runstate Steven Sistare
2023-12-11 6:56 ` Peter Xu
2023-12-11 13:31 ` Steven Sistare
2023-12-12 8:54 ` Peter Xu
-- strict thread matches above, loose matches on Subject: below --
2023-12-06 17:12 Steve Sistare
2023-12-06 17:12 ` [PATCH V7 03/12] cpus: check running not RUN_STATE_RUNNING Steve Sistare
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=1701883417-356268-4-git-send-email-steven.sistare@oracle.com \
--to=steven.sistare@oracle.com \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=leobras@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).