To query whether migration is active. Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>
Index: qemu/migration.c =================================================================== --- qemu.orig/migration.c +++ qemu/migration.c @@ -480,3 +480,13 @@ int get_migration_state(void) return MIG_STATE_ERROR; } } + +bool migration_active(void) +{ + if (current_migration && + current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) { + return true; + } + + return false; +} Index: qemu/migration.h =================================================================== --- qemu.orig/migration.h +++ qemu/migration.h @@ -139,4 +139,6 @@ void add_migration_state_change_notifier void remove_migration_state_change_notifier(Notifier *notify); int get_migration_state(void); +bool migration_active(void); + #endif