From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arNlj-0006gK-GC for qemu-devel@nongnu.org; Sat, 16 Apr 2016 06:48:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arNli-0000yF-I1 for qemu-devel@nongnu.org; Sat, 16 Apr 2016 06:48:03 -0400 References: <1460690887-32751-1-git-send-email-famz@redhat.com> <1460690887-32751-2-git-send-email-famz@redhat.com> From: "Denis V. Lunev" Message-ID: <57121854.10502@openvz.org> Date: Sat, 16 Apr 2016 13:47:48 +0300 MIME-Version: 1.0 In-Reply-To: <1460690887-32751-2-git-send-email-famz@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.7 v2 01/17] block: Add BDRV_O_NO_LOCK List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , 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 On 04/15/2016 06:27 AM, Fam Zheng wrote: > Later the block layer will automatically lock the images to avoid unexpected > concurrent accesses to the same image, which will easily corrupt the metadata > or user data, unless in some very special cases, like migration. > > The exceptional cases like shared storage migration and testing should set > BDRV_O_NO_LOCK the flag indicating that the block layer should skip the > automatic locking of the image, like the old behavior. > > Signed-off-by: Fam Zheng > --- > include/block/block.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/block/block.h b/include/block/block.h > index 3a73137..b803597 100644 > --- a/include/block/block.h > +++ b/include/block/block.h > @@ -94,6 +94,7 @@ typedef struct HDGeometry { > select an appropriate protocol driver, > ignoring the format layer */ > #define BDRV_O_NO_IO 0x10000 /* don't initialize for I/O */ > +#define BDRV_O_NO_LOCK 0x20000 /* don't lock image file */ > > #define BDRV_O_CACHE_MASK (BDRV_O_NOCACHE | BDRV_O_NO_FLUSH) > Reviewed-by: Denis V. Lunev