[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V9 17/46] migration: check mode in notifiers
From: |
Steve Sistare |
Subject: |
[PATCH V9 17/46] migration: check mode in notifiers |
Date: |
Tue, 26 Jul 2022 09:10:14 -0700 |
The existing notifiers should only apply to normal mode.
No functional change.
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
---
hw/net/virtio-net.c | 4 ++++
hw/vfio/migration.c | 3 +++
ui/spice-core.c | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 29af1a5..06f0dbe 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3351,6 +3351,10 @@ static void
virtio_net_handle_migration_primary(VirtIONet *n, MigrationState *s)
static void virtio_net_migration_state_notifier(Notifier *notifier, void *data)
{
MigrationState *s = data;
+
+ if (migrate_mode_of(s) != MIG_MODE_NORMAL) {
+ return;
+ }
VirtIONet *n = container_of(notifier, VirtIONet, migration_state);
virtio_net_handle_migration_primary(n, s);
}
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 5109124..6b0d401 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -759,6 +759,9 @@ static void vfio_migration_state_notifier(Notifier
*notifier, void *data)
VFIODevice *vbasedev = migration->vbasedev;
int ret;
+ if (migrate_mode_of(s) != MIG_MODE_NORMAL) {
+ return;
+ }
trace_vfio_migration_state_notifier(vbasedev->name,
MigrationStatus_str(s->state));
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 62b7893..413c392 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -558,7 +558,7 @@ static void migration_state_notifier(Notifier *notifier,
void *data)
{
MigrationState *s = data;
- if (!spice_have_target_host) {
+ if (!spice_have_target_host || migrate_mode_of(s) != MIG_MODE_NORMAL) {
return;
}
--
1.8.3.1
- [PATCH V9 35/46] vhost: reset vhost devices for cpr, (continued)
- [PATCH V9 35/46] vhost: reset vhost devices for cpr, Steve Sistare, 2022/07/26
- [PATCH V9 22/46] cpr: exec mode, Steve Sistare, 2022/07/26
- [PATCH V9 16/46] migration: simplify notifiers, Steve Sistare, 2022/07/26
- [PATCH V9 26/46] cpr: Mismatched GPAs fix, Steve Sistare, 2022/07/26
- [PATCH V9 37/46] chardev: cpr for simple devices, Steve Sistare, 2022/07/26
- [PATCH V9 38/46] chardev: cpr for pty, Steve Sistare, 2022/07/26
- [PATCH V9 32/46] vfio-pci: cpr part 2 (msi), Steve Sistare, 2022/07/26
- [PATCH V9 34/46] vfio-pci: recover from unmap-all-vaddr failure, Steve Sistare, 2022/07/26
- [PATCH V9 40/46] python/machine: QEMUMachine full_args, Steve Sistare, 2022/07/26
- [PATCH V9 17/46] migration: check mode in notifiers,
Steve Sistare <=
- [PATCH V9 45/46] migration: notifier error reporting, Steve Sistare, 2022/07/26
- [PATCH V9 36/46] chardev: cpr framework, Steve Sistare, 2022/07/26
- [PATCH V9 41/46] python/machine: QEMUMachine reopen_qmp_connection, Steve Sistare, 2022/07/26
- [PATCH V9 43/46] vl: start on wakeup request, Steve Sistare, 2022/07/26
- [PATCH V9 44/46] migration: fix suspended runstate, Steve Sistare, 2022/07/26
- [PATCH V9 42/46] tests/avocado: add cpr regression test, Steve Sistare, 2022/07/26
- [PATCH V9 46/46] vfio: allow cpr-reboot migration if suspended, Steve Sistare, 2022/07/26
- [PATCH V9 23/46] cpr: add exec-mode blockers, Steve Sistare, 2022/07/26