Received: from eggs.gnu.org ([2001:4830:134:3::10]:33029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avlXL-0003oa-9V for qemu-devel@nongnu.org; Thu, 28 Apr 2016 08:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avlXK-0000ev-GY for qemu-devel@nongnu.org; Thu, 28 Apr 2016 08:59:19 -0400 From: Fam Zheng Date: Thu, 28 Apr 2016 20:57:37 +0800 Message-Id: <1461848266-32119-19-git-send-email-famz@redhat.com> In-Reply-To: <1461848266-32119-1-git-send-email-famz@redhat.com> References: <1461848266-32119-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v3 18/27] mirror: Disable image locking on target backing chain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Max Reitz , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, den@openvz.org, stefanha@redhat.com In sync=none the backing image of s->target is s->common.bs, which could be exclusively locked, the image locking wouldn't work here. Later we can update completion code to lock it after the replaced node has dropped its lock. Signed-off-by: Fam Zheng --- blockdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/blockdev.c b/blockdev.c index e3882d6..9968568 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3617,6 +3617,12 @@ void qmp_drive_mirror(const char *device, const char *target, * file. */ target_bs = NULL; + if (sync == MIRROR_SYNC_MODE_NONE) { + flags |= BDRV_O_NO_LOCK; + } + /* TODO: in mirror complete, after target_bs is switched to and the + * original BDS's lock is dropped, we should enable the lock on target_bs. + * */ ret = bdrv_open(&target_bs, target, NULL, options, flags | BDRV_O_NO_BACKING, &local_err); if (ret < 0) { -- 2.8.0