aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-02-22 09:28:29 -0800
committerPeter Xu <peterx@redhat.com>2024-02-28 11:31:28 +0800
commit3e7757301cc93eaca47cad855630467804b1a2a4 (patch)
tree57009f7020638d407965a51dd8d96bc5eadc06d8 /migration
parentd91f33c72e1fed8ad8727a670622704e02110562 (diff)
migration: convert to NotifierWithReturn
Change all migration notifiers to type NotifierWithReturn, so notifiers can return an error status in a future patch. For now, pass NULL for the notifier error parameter, and do not check the return value. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Link: https://lore.kernel.org/r/1708622920-68779-4-git-send-email-steven.sistare@oracle.com [peterx: dropped unexpected update to roms/seabios-hppa] Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/migration/migration.c b/migration/migration.c
index ab21de2cad..6d4072e8e9 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -69,8 +69,8 @@
#include "qemu/sockets.h"
#include "sysemu/kvm.h"
-static NotifierList migration_state_notifiers =
- NOTIFIER_LIST_INITIALIZER(migration_state_notifiers);
+static NotifierWithReturnList migration_state_notifiers =
+ NOTIFIER_WITH_RETURN_LIST_INITIALIZER(migration_state_notifiers);
/* Messages sent on the return path from destination to source */
enum mig_rp_message_type {
@@ -1459,24 +1459,24 @@ static void migrate_fd_cancel(MigrationState *s)
}
}
-void migration_add_notifier(Notifier *notify,
- void (*func)(Notifier *notifier, void *data))
+void migration_add_notifier(NotifierWithReturn *notify,
+ NotifierWithReturnFunc func)
{
notify->notify = func;
- notifier_list_add(&migration_state_notifiers, notify);
+ notifier_with_return_list_add(&migration_state_notifiers, notify);
}
-void migration_remove_notifier(Notifier *notify)
+void migration_remove_notifier(NotifierWithReturn *notify)
{
if (notify->notify) {
- notifier_remove(notify);
+ notifier_with_return_remove(notify);
notify->notify = NULL;
}
}
void migration_call_notifiers(MigrationState *s)
{
- notifier_list_notify(&migration_state_notifiers, s);
+ notifier_with_return_list_notify(&migration_state_notifiers, s, 0);
}
bool migration_in_setup(MigrationState *s)