mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
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>
This commit is contained in:
committed by
Juan Quintela
parent
2c36076a11
commit
d9cda21303
@ -3624,8 +3624,8 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
|
||||
n->primary_listener.hide_device = failover_hide_primary_device;
|
||||
qatomic_set(&n->failover_primary_hidden, true);
|
||||
device_listener_register(&n->primary_listener);
|
||||
n->migration_state.notify = virtio_net_migration_state_notifier;
|
||||
add_migration_state_change_notifier(&n->migration_state);
|
||||
migration_add_notifier(&n->migration_state,
|
||||
virtio_net_migration_state_notifier);
|
||||
n->host_features |= (1ULL << VIRTIO_NET_F_STANDBY);
|
||||
}
|
||||
|
||||
@ -3788,7 +3788,7 @@ static void virtio_net_device_unrealize(DeviceState *dev)
|
||||
if (n->failover) {
|
||||
qobject_unref(n->primary_opts);
|
||||
device_listener_unregister(&n->primary_listener);
|
||||
remove_migration_state_change_notifier(&n->migration_state);
|
||||
migration_remove_notifier(&n->migration_state);
|
||||
} else {
|
||||
assert(n->primary_opts == NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user