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>
This commit is contained in:
parent
b9ae473d80
commit
0f1db069b6
@ -904,7 +904,7 @@ static void tpm_emulator_vm_state_change(void *opaque, bool running,
|
|||||||
|
|
||||||
trace_tpm_emulator_vm_state_change(running, state);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
* USB-devices which have async handled packages have a packet in the
|
||||||
* ep queue to match the completion with.
|
* ep queue to match the completion with.
|
||||||
*/
|
*/
|
||||||
if (state == RUN_STATE_RUNNING) {
|
if (running) {
|
||||||
ehci_advance_async_state(ehci);
|
ehci_advance_async_state(ehci);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,7 +1403,7 @@ static void usbredir_vm_state_change(void *priv, bool running, RunState state)
|
|||||||
{
|
{
|
||||||
USBRedirDevice *dev = priv;
|
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 */
|
usbredirparser_do_write(dev->parser); /* Flush any pending writes */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -623,7 +623,7 @@ void xen_hvm_change_state_handler(void *opaque, bool running,
|
|||||||
|
|
||||||
xen_set_ioreq_server_state(xen_domid,
|
xen_set_ioreq_server_state(xen_domid,
|
||||||
state->ioservid,
|
state->ioservid,
|
||||||
(rstate == RUN_STATE_RUNNING));
|
running);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xen_exit_notifier(Notifier *n, void *data)
|
void xen_exit_notifier(Notifier *n, void *data)
|
||||||
|
Loading…
Reference in New Issue
Block a user