From patchwork Mon Apr 14 16:03:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 338996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A0CEF140077 for ; Tue, 15 Apr 2014 02:04:29 +1000 (EST) Received: from localhost ([::1]:44034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZjMx-0003dW-HO for incoming@patchwork.ozlabs.org; Mon, 14 Apr 2014 12:04:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZjMe-00034Q-Oi for qemu-devel@nongnu.org; Mon, 14 Apr 2014 12:04:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZjMY-0005Bk-H0 for qemu-devel@nongnu.org; Mon, 14 Apr 2014 12:04:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZjMY-0005BY-9l for qemu-devel@nongnu.org; Mon, 14 Apr 2014 12:04:02 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3EG41PA012630 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Apr 2014 12:04:01 -0400 Received: from dgilbert-t530.home.treblig.org (vpn1-7-233.ams2.redhat.com [10.36.7.233]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3EG3x0p016438; Mon, 14 Apr 2014 12:04:00 -0400 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org Date: Mon, 14 Apr 2014 17:03:59 +0100 Message-Id: <1397491439-17820-1-git-send-email-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: afaerber@suse.de, quintela@redhat.com Subject: [Qemu-devel] [PATCH v2 1/1] Disallow outward migration while awaiting incoming migration 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 From: "Dr. David Alan Gilbert" QEMU will assert if you attempt to start an outgoing migration on a QEMU that's sitting waiting for an incoming migration (started with -incoming), so disallow it with a proper error. (This is a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1086987 ) Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Andreas Färber Reviewed-by: Eric Blake --- v2 Just use error_setg rather than adding a new QERR_ migration.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migration.c b/migration.c index bd1fb91..ac23275 100644 --- a/migration.c +++ b/migration.c @@ -419,6 +419,11 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, return; } + if (runstate_check(RUN_STATE_INMIGRATE)) { + error_setg(errp, "Guest is waiting for an incoming migration"); + return; + } + if (qemu_savevm_state_blocked(errp)) { return; }