[1/3] add migration_active function

Submitted by Marcelo Tosatti on Feb. 22, 2011, 5 p.m.

Details

Message ID 20110222170115.658100551@redhat.com
State New
Headers show

Commit Message

Marcelo Tosatti Feb. 22, 2011, 5 p.m.
To query whether migration is active.

Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>

Patch hide | download patch | download mbox

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