migration: notifier error checking

Check the status returned by migration notifiers for event type
MIG_EVENT_PRECOPY_SETUP, and report errors.  None of the notifiers
return an error status at this time.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/1708622920-68779-10-git-send-email-steven.sistare@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
Steve Sistare 2024-02-22 09:28:35 -08:00 committed by Peter Xu
parent bf78a046b9
commit 4af667f87c
2 changed files with 23 additions and 10 deletions

View file

@ -72,6 +72,11 @@ typedef struct MigrationEvent {
MigrationEventType type;
} MigrationEvent;
/*
* A MigrationNotifyFunc may return an error code and an Error object,
* but only when @e->type is MIG_EVENT_PRECOPY_SETUP. The code is an int
* to allow for different failure modes and recovery actions.
*/
typedef int (*MigrationNotifyFunc)(NotifierWithReturn *notify,
MigrationEvent *e, Error **errp);
@ -93,7 +98,8 @@ void migration_add_notifier_mode(NotifierWithReturn *notify,
MigrationNotifyFunc func, MigMode mode);
void migration_remove_notifier(NotifierWithReturn *notify);
void migration_call_notifiers(MigrationState *s, MigrationEventType type);
int migration_call_notifiers(MigrationState *s, MigrationEventType type,
Error **errp);
bool migration_in_setup(MigrationState *);
bool migration_has_finished(MigrationState *);
bool migration_has_failed(MigrationState *);