aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2023-06-07 07:42:34 -0700
committerJuan Quintela <quintela@redhat.com>2023-10-20 08:51:41 +0200
commitd9cda21303a2b92cf3be48b75d4201896aa06857 (patch)
treeec662a0385160804d820302cfe9b296b0c4940ae /hw/vfio
parent2c36076a1153e321e32a28b735f5c0fe70d8d10f (diff)
downloadqemu-d9cda21303a2b92cf3be48b75d4201896aa06857.zip
qemu-d9cda21303a2b92cf3be48b75d4201896aa06857.tar.gz
qemu-d9cda21303a2b92cf3be48b75d4201896aa06857.tar.bz2
migration: simplify notifiers
Pass the callback function to add_migration_state_change_notifier so that migration can initialize the notifier on add and clear it on delete, which simplifies the call sites. Shorten the function names so the extra arg can be added more legibly. Hide the global notifier list in a new function migration_call_notifiers, and make it externally visible so future live update code can call it. No functional change. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Peter Xu <peterx@redhat.com> Tested-by: Michael Galaxy <mgalaxy@akamai.com> Reviewed-by: Michael Galaxy <mgalaxy@akamai.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Message-ID: <1686148954-250144-1-git-send-email-steven.sistare@oracle.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r--hw/vfio/migration.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 0aaad65..28d422b 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -872,8 +872,8 @@ static int vfio_migration_init(VFIODevice *vbasedev)
NULL;
migration->vm_state = qdev_add_vm_change_state_handler_full(
vbasedev->dev, vfio_vmstate_change, prepare_cb, vbasedev);
- migration->migration_state.notify = vfio_migration_state_notifier;
- add_migration_state_change_notifier(&migration->migration_state);
+ migration_add_notifier(&migration->migration_state,
+ vfio_migration_state_notifier);
return 0;
}
@@ -882,7 +882,7 @@ static void vfio_migration_deinit(VFIODevice *vbasedev)
{
VFIOMigration *migration = vbasedev->migration;
- remove_migration_state_change_notifier(&migration->migration_state);
+ migration_remove_notifier(&migration->migration_state);
qemu_del_vm_change_state_handler(migration->vm_state);
unregister_savevm(VMSTATE_IF(vbasedev->dev), "vfio", vbasedev);
vfio_migration_free(vbasedev);