From patchwork Mon Nov 30 17:21:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 39823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 54C361007D2 for ; Tue, 1 Dec 2009 04:48:33 +1100 (EST) Received: from localhost ([127.0.0.1]:37936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFAMQ-0006mu-Ap for incoming@patchwork.ozlabs.org; Mon, 30 Nov 2009 12:48:30 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFA2g-0003oJ-J0 for qemu-devel@nongnu.org; Mon, 30 Nov 2009 12:28:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFA2W-0003gu-IM for qemu-devel@nongnu.org; Mon, 30 Nov 2009 12:28:00 -0500 Received: from [199.232.76.173] (port=36075 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFA2W-0003gC-1h for qemu-devel@nongnu.org; Mon, 30 Nov 2009 12:27:56 -0500 Received: from goliath.siemens.de ([192.35.17.28]:16737) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFA2U-0004fQ-TR for qemu-devel@nongnu.org; Mon, 30 Nov 2009 12:27:55 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id nAUHRp5X025356; Mon, 30 Nov 2009 18:27:51 +0100 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id nAUHRoH1001964; Mon, 30 Nov 2009 18:27:50 +0100 Resent-From: Jan Kiszka Resent-To: Anthony Liguori Resent-Cc: qemu-devel , Liran Schour , Pierre Riteau Resent-Date: Mon, 30 Nov 2009 18:27:50 +0100 Resent-Message-Id: <4B140096.8020804@siemens.com> Resent-User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 From: Jan Kiszka To: Anthony Liguori Date: Mon, 30 Nov 2009 18:21:19 +0100 Message-ID: <20091130172119.22889.20551.stgit@mchn012c.ww002.siemens.net> In-Reply-To: <20091130172119.22889.28114.stgit@mchn012c.ww002.siemens.net> References: <20091130172119.22889.28114.stgit@mchn012c.ww002.siemens.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Resent-Date: Mon, 30 Nov 2009 12:28:00 -0500 Cc: qemu-devel@nongnu.org, Liran Schour , Pierre Riteau Subject: [Qemu-devel] [PATCH 02/23] migration: Catch multiple start commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Jan Kiszka --- migration.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) 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"),