From patchwork Mon May 23 21:31:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 97071 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DE7BBB6FBA for ; Tue, 24 May 2011 07:35:19 +1000 (EST) Received: from localhost ([::1]:44776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOcmT-0005qP-8C for incoming@patchwork.ozlabs.org; Mon, 23 May 2011 17:35:17 -0400 Received: from eggs.gnu.org ([140.186.70.92]:54492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOcly-0005kf-2D for qemu-devel@nongnu.org; Mon, 23 May 2011 17:34:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOclu-0001rr-4Y for qemu-devel@nongnu.org; Mon, 23 May 2011 17:34:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOclt-0001r8-IQ for qemu-devel@nongnu.org; Mon, 23 May 2011 17:34:41 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4NLYd7b008524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 May 2011 17:34:39 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4NLYdnM022581; Mon, 23 May 2011 17:34:39 -0400 Received: from amt.cnet (vpn-11-169.rdu.redhat.com [10.11.11.169]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p4NLYcM4004474; Mon, 23 May 2011 17:34:38 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id B66746520EC; Mon, 23 May 2011 18:34:25 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p4NLYPW0004599; Mon, 23 May 2011 18:34:25 -0300 Message-Id: <20110523213411.080716110@amt.cnet> User-Agent: quilt/0.48-1 Date: Mon, 23 May 2011 18:31:22 -0300 From: Marcelo Tosatti To: qemu-devel@nongnu.org References: <20110523213115.164535428@amt.cnet> Content-Disposition: inline; filename=3-3-do-not-allow-migration-if-block-copy-in-progress.patch X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com, dlaor@redhat.com, avi@redhat.com, Marcelo Tosatti Subject: [Qemu-devel] [patch 7/7] do not allow migration if block copy in progress 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: Marcelo Tosatti Index: qemu-block-copy/migration.c =================================================================== --- qemu-block-copy.orig/migration.c +++ qemu-block-copy/migration.c @@ -19,6 +19,7 @@ #include "block.h" #include "qemu_socket.h" #include "block-migration.h" +#include "block-copy.h" #include "qemu-objects.h" //#define DEBUG_MIGRATION @@ -95,6 +96,11 @@ int do_migrate(Monitor *mon, const QDict return -1; } + if (block_copy_active()) { + monitor_printf(mon, "block copy in progress\n"); + return -1; + } + if (strstart(uri, "tcp:", &p)) { s = tcp_start_outgoing_migration(mon, p, max_throttle, detach, blk, inc);