[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [patch 1/3] add migration_active function
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [patch 1/3] add migration_active function |
Date: |
Thu, 16 Dec 2010 15:44:20 -0200 |
User-agent: |
quilt/0.47-1 |
To query whether migration is active.
Signed-off-by: Marcelo Tosatti <address@hidden>
Index: qemu-kvm-block-copy/migration.c
===================================================================
--- qemu-kvm-block-copy.orig/migration.c
+++ qemu-kvm-block-copy/migration.c
@@ -448,3 +448,13 @@ int migrate_fd_close(void *opaque)
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
return s->close(s);
}
+
+bool migration_active(void)
+{
+ if (current_migration &&
+ current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
+ return true;
+ }
+
+ return false;
+}
Index: qemu-kvm-block-copy/migration.h
===================================================================
--- qemu-kvm-block-copy.orig/migration.h
+++ qemu-kvm-block-copy/migration.h
@@ -134,4 +134,6 @@ static inline FdMigrationState *migrate_
return container_of(mig_state, FdMigrationState, mig_state);
}
+bool migration_active(void);
+
#endif