From 1302425d737857e7598b812eb25c159f31d4ab27 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Mon, 30 Nov 2009 18:21:19 +0100 Subject: migration: Catch multiple start commands Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- migration.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/migration.c b/migration.c index dcde7c38da..d7fb75676e 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"), -- cgit v1.2.3