migration: add status query functions
Add migration_is_active and migration_has_failed functions to query migration state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
952e849c15
commit
afe2df69cf
11
migration.c
11
migration.c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user