From patchwork Tue Jun 9 02:13:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 482080 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 C8D6914031F for ; Tue, 9 Jun 2015 12:15:27 +1000 (AEST) Received: from localhost ([::1]:60948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z294X-00028u-VH for incoming@patchwork.ozlabs.org; Mon, 08 Jun 2015 22:15:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z293D-0008Ba-Jg for qemu-devel@nongnu.org; Mon, 08 Jun 2015 22:14:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z293C-0000lu-OG for qemu-devel@nongnu.org; Mon, 08 Jun 2015 22:14:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z293A-0000l4-DO; Mon, 08 Jun 2015 22:14:00 -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 199CD8F28B; Tue, 9 Jun 2015 02:14:00 +0000 (UTC) Received: from ad.nay.redhat.com (dhcp-14-104.nay.redhat.com [10.66.14.104]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t592DlYo006557; Mon, 8 Jun 2015 22:13:56 -0400 From: Fam Zheng To: qemu-devel@nongnu.org Date: Tue, 9 Jun 2015 10:13:43 +0800 Message-Id: <1433816027-32588-3-git-send-email-famz@redhat.com> In-Reply-To: <1433816027-32588-1-git-send-email-famz@redhat.com> References: <1433816027-32588-1-git-send-email-famz@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: Kevin Wolf , qemu-block@nongnu.org, Jeff Cody , Markus Armbruster , mreitz@redhat.com, Stefan Hajnoczi , pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 2/6] block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE 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 It's necessary to distinguish source and target before we can add blockdev-mirror, because we would want a concrete type of operation to check on target bs before starting. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- blockdev.c | 2 +- hw/block/dataplane/virtio-blk.c | 2 +- include/block/block.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 90f6e77..b573e56 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2962,7 +2962,7 @@ void qmp_drive_mirror(const char *device, const char *target, } } - if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_MIRROR, errp)) { + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_MIRROR_SOURCE, errp)) { goto out; } diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 3db139b..dac37de 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -206,7 +206,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT, s->blocker); blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE, s->blocker); - blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_MIRROR, s->blocker); + blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_MIRROR_SOURCE, s->blocker); blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_STREAM, s->blocker); blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_REPLACE, s->blocker); diff --git a/include/block/block.h b/include/block/block.h index f5c0a90..69cb676 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -155,7 +155,7 @@ typedef enum BlockOpType { BLOCK_OP_TYPE_EXTERNAL_SNAPSHOT, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE, - BLOCK_OP_TYPE_MIRROR, + BLOCK_OP_TYPE_MIRROR_SOURCE, BLOCK_OP_TYPE_RESIZE, BLOCK_OP_TYPE_STREAM, BLOCK_OP_TYPE_REPLACE,