diff mbox

[02/23] migration: Catch multiple start commands

Message ID 20091130172119.22889.20551.stgit@mchn012c.ww002.siemens.net
State New
Headers show

Commit Message

Jan Kiszka Nov. 30, 2009, 5:21 p.m. UTC
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

 migration.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/migration.c b/migration.c
index dcde7c3..d7fb756 100644
--- a/migration.c
+++ b/migration.c
@@ -58,7 +58,13 @@  void do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
     const char *p;
     int detach = qdict_get_int(qdict, "detach");
     const char *uri = qdict_get_str(qdict, "uri");
-    
+
+    if (current_migration &&
+        current_migration->get_status(current_migration) == MIG_STATE_ACTIVE) {
+        monitor_printf(mon, "migration already in progress\n");
+        return;
+    }
+
     if (strstart(uri, "tcp:", &p))
         s = tcp_start_outgoing_migration(p, max_throttle, detach, 
                                          (int)qdict_get_int(qdict, "blk"),