diff options
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/migration.c b/migration.c index 6c70f72ce3..3b4abbde64 100644 --- a/migration.c +++ b/migration.c @@ -336,11 +336,22 @@ void remove_migration_state_change_notifier(Notifier *notify) notifier_list_remove(&migration_state_notifiers, notify); } +bool migration_is_active(MigrationState *s) +{ + return s->state == MIG_STATE_ACTIVE; +} + bool migration_has_finished(MigrationState *s) { return s->state == MIG_STATE_COMPLETED; } +bool migration_has_failed(MigrationState *s) +{ + return (s->state == MIG_STATE_CANCELLED || + s->state == MIG_STATE_ERROR); +} + void migrate_fd_connect(MigrationState *s) { int ret; |