From patchwork Tue Feb 22 17:00:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 83997 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 67FA4B70CD for ; Wed, 23 Feb 2011 07:13:41 +1100 (EST) Received: from localhost ([127.0.0.1]:35890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PryWT-0006XJ-S8 for incoming@patchwork.ozlabs.org; Tue, 22 Feb 2011 15:07:49 -0500 Received: from [140.186.70.92] (port=54837 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PryVQ-0006VR-RN for qemu-devel@nongnu.org; Tue, 22 Feb 2011 15:06:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PryVI-0007Ib-FU for qemu-devel@nongnu.org; Tue, 22 Feb 2011 15:06:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PryVI-0007Ht-60 for qemu-devel@nongnu.org; Tue, 22 Feb 2011 15:06:36 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1MK6WPY001148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Feb 2011 15:06:32 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1MK6VYL023702; Tue, 22 Feb 2011 15:06:31 -0500 Received: from amt.cnet (vpn-10-183.rdu.redhat.com [10.11.10.183]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p1MK6UqJ007143; Tue, 22 Feb 2011 15:06:30 -0500 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 2D2C768A042; Tue, 22 Feb 2011 17:06:19 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p1MK6I3X008579; Tue, 22 Feb 2011 17:06:18 -0300 Message-Id: <20110222170115.762483303@redhat.com> User-Agent: quilt/0.47-1 Date: Tue, 22 Feb 2011 14:00:07 -0300 From: Marcelo Tosatti To: qemu-devel@nongnu.org References: <20110222170004.808373778@redhat.com> Content-Disposition: inline; filename=3-3-do-not-allow-migration-if-block-copy-in-progress.patch X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Jes.Sorensen@redhat.com, Marcelo Tosatti , avi@redhat.com Subject: [Qemu-devel] [patch 3/3] do not allow migration if block copy in progress 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: Marcelo Tosatti Index: qemu/migration.c =================================================================== --- qemu.orig/migration.c +++ qemu/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);