From patchwork Mon Jul 23 14:23:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Benoit Canet X-Patchwork-Id: 172697 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DC0D02C0261 for ; Tue, 24 Jul 2012 00:24:03 +1000 (EST) Received: from localhost ([::1]:44036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StJYH-00009Z-VJ for incoming@patchwork.ozlabs.org; Mon, 23 Jul 2012 10:24:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StJXV-0006TR-NI for qemu-devel@nongnu.org; Mon, 23 Jul 2012 10:23:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StJXR-0005vl-Kd for qemu-devel@nongnu.org; Mon, 23 Jul 2012 10:23:13 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:65306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StJXR-0005uq-Dd for qemu-devel@nongnu.org; Mon, 23 Jul 2012 10:23:09 -0400 Received: by mail-bk0-f45.google.com with SMTP id ji1so4506612bkc.4 for ; Mon, 23 Jul 2012 07:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=/7hqem1lTJkBvBqGNANe0PzUrnyOLC7s89LbavJvYM4=; b=j+rz2DCCDh2G0GJSfid6gph4fca1k3jM178/3uLlcVsCN6D31aQsTko9j7TK3AJiwL wvq5UATyY/JJl945rL6uiPo/yClgLsh3UPsMrdJ0Q9Tg0fJUvY4ihZm186hrXoOX2E0Q ExPLKpohQzw7Kl7H/3RYiSyWI9u8WonD0Xx3xYVC3kzG2D1FK9M4F8bqRoPuJgN24PeW ezmC36sMrYfhit1QTGbqhE8pWAUd/t+CFdKHVAmHvgGV/TqB6nlmtp0UUOyYjSYhPeoK WjB42UJKbKgNfuTBve3yUgYcs1qpHdjctcebGmnVqJ/C/NBYtuYUeskBSVJ1tEv29rH8 HVMQ== Received: by 10.204.145.90 with SMTP id c26mr7939328bkv.34.1343053389023; Mon, 23 Jul 2012 07:23:09 -0700 (PDT) Received: from Laure.box.in.irqsave.net (paradis.irqsave.net. [109.190.18.76]) by mx.google.com with ESMTPS id he8sm7745617bkc.3.2012.07.23.07.23.07 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jul 2012 07:23:08 -0700 (PDT) From: benoit.canet@gmail.com To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2012 16:23:00 +0200 Message-Id: <1343053380-12133-4-git-send-email-benoit@irqsave.net> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343053380-12133-1-git-send-email-benoit@irqsave.net> References: <1343053380-12133-1-git-send-email-benoit@irqsave.net> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.45 Cc: kwolf@redhat.com, stefanha@gmail.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@linux.vnet.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH V4 3/3] migration: block migration when any of the block device is busy 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: BenoĆ®t Canet Signed-off-by: Benoit Canet --- migration.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migration.c b/migration.c index 8db1b43..3d68996 100644 --- a/migration.c +++ b/migration.c @@ -425,6 +425,11 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, return; } + if (bdrv_are_busy()) { + error_set(errp, QERR_BLOCK_DEV_IN_USE_MIGRATION_PREVENTED); + return; + } + s = migrate_init(¶ms); if (strstart(uri, "tcp:", &p)) {