From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWkNO-0004Fp-BI for qemu-devel@nongnu.org; Mon, 08 Aug 2016 09:13:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWkNN-0005jN-F7 for qemu-devel@nongnu.org; Mon, 08 Aug 2016 09:13:54 -0400 From: Fam Zheng Date: Mon, 8 Aug 2016 21:13:15 +0800 Message-Id: <1470662013-19785-3-git-send-email-famz@redhat.com> In-Reply-To: <1470662013-19785-1-git-send-email-famz@redhat.com> References: <1470662013-19785-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v7 02/20] qapi: Add lock-mode in blockdev-add options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, rjones@redhat.com, John Snow , Jeff Cody , Markus Armbruster , Max Reitz , stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, berrange@redhat.com To allow overriding the default locking behavior when opening the image. Signed-off-by: Fam Zheng --- qapi/block-core.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 5e2d7d7..d1eb197 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2151,6 +2151,20 @@ '*debug-level': 'int' } } ## +# @BlockdevLockMode +# +# Describes how QEMU should lock the image. +# +# @off: Disabled +# @shared: Use shared lock for both RO and RW images. +# @auto: Use exclusive lock for RW images, and shared lock for RO images. +# +# Since: 2.7 +## +{ 'enum': 'BlockdevLockMode', + 'data': [ 'off', 'shared', 'auto' ] } + +## # @BlockdevOptions # # Options for creating a block device. Many options are available for all @@ -2172,6 +2186,8 @@ # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1) # (default: off) # +# @lock-mode: #optional how to lock the image. (default: auto) (Since 2.7) +# # Remaining options are determined by the block driver. # # Since: 1.7 @@ -2185,7 +2201,8 @@ '*cache': 'BlockdevCacheOptions', '*aio': 'BlockdevAioOptions', '*read-only': 'bool', - '*detect-zeroes': 'BlockdevDetectZeroesOptions' }, + '*detect-zeroes': 'BlockdevDetectZeroesOptions', + '*lock-mode': 'BlockdevLockMode' }, 'discriminator': 'driver', 'data': { 'archipelago':'BlockdevOptionsArchipelago', -- 2.7.4