提交 afe2df69 编写于 作者: G Gerd Hoffmann

migration: add status query functions

Add migration_is_active and migration_has_failed functions
to query migration state.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 952e849c
......@@ -372,11 +372,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;
......
......@@ -76,7 +76,9 @@ void migrate_fd_connect(MigrationState *s);
void add_migration_state_change_notifier(Notifier *notify);
void remove_migration_state_change_notifier(Notifier *notify);
bool migration_is_active(MigrationState *);
bool migration_has_finished(MigrationState *);
bool migration_has_failed(MigrationState *);
uint64_t ram_bytes_remaining(void);
uint64_t ram_bytes_transferred(void);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册