mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
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
2 changed files with 13 additions and 0 deletions
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue