Patchwork [1/3] add migration_active function

login
register
mail settings
Submitter Marcelo Tosatti
Date Feb. 22, 2011, 5 p.m.
Message ID <20110222170115.658100551@redhat.com>
Download mbox | patch
Permalink /patch/83996/
State New
Headers show

Comments

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

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

Patch

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