From patchwork Wed Jul 1 10:39:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 490062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9C8771402B2 for ; Wed, 1 Jul 2015 20:53:31 +1000 (AEST) Received: from localhost ([::1]:57107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAFdx-0004zb-TJ for incoming@patchwork.ozlabs.org; Wed, 01 Jul 2015 06:53:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAFRO-0008KD-NU for qemu-devel@nongnu.org; Wed, 01 Jul 2015 06:40:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAFRN-0002hQ-Vz for qemu-devel@nongnu.org; Wed, 01 Jul 2015 06:40:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAFRN-0002hF-MR for qemu-devel@nongnu.org; Wed, 01 Jul 2015 06:40:29 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 56E1AB82B7 for ; Wed, 1 Jul 2015 10:40:29 +0000 (UTC) Received: from trasno.mitica (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t61Adp42016283; Wed, 1 Jul 2015 06:40:28 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 1 Jul 2015 12:39:46 +0200 Message-Id: <1435747190-18017-23-git-send-email-quintela@redhat.com> In-Reply-To: <1435747190-18017-1-git-send-email-quintela@redhat.com> References: <1435747190-18017-1-git-send-email-quintela@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: amit.shah@redhat.com Subject: [Qemu-devel] [PULL 22/26] migration: ensure we start in NONE state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 1e34aa5..5c1233f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -694,7 +694,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, error_setg(errp, QERR_MIGRATION_ACTIVE); return; } - if (runstate_check(RUN_STATE_INMIGRATE)) { error_setg(errp, "Guest is waiting for an incoming migration"); return; @@ -709,6 +708,12 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, return; } + /* We are starting a new migration, so we want to start in a clean + state. This change is only needed if previous migration + failed/was cancelled. We don't use migrate_set_state() because + we are setting the initial state, not changing it. */ + s->state = MIGRATION_STATUS_NONE; + s = migrate_init(¶ms); if (strstart(uri, "tcp:", &p)) {