Received: from eggs.gnu.org ([2001:4830:134:3::10]:46667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2ZXg-0007xF-Te for qemu-devel@nongnu.org; Tue, 17 May 2016 03:35:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2ZXa-0003j3-Iv for qemu-devel@nongnu.org; Tue, 17 May 2016 03:35:48 -0400 From: Fam Zheng Date: Tue, 17 May 2016 15:35:11 +0800 Message-Id: <1463470536-8981-3-git-send-email-famz@redhat.com> In-Reply-To: <1463470536-8981-1-git-send-email-famz@redhat.com> References: <1463470536-8981-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v5 02/27] 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 , 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 To allow overriding the default locking behavior when opening the image. Signed-off-by: Fam Zheng --- qapi/block-core.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 98a20d2..3c54f64 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2032,6 +2032,21 @@ '*read-pattern': 'QuorumReadPattern' } } ## +# @BlockdevLockMode +# +# Describes the operation mode for the automatic conversion of plain +# zero writes by the OS to driver specific optimized zero write commands. +# +# @off: Disabled +# @shared: Use shared lock for both RO and RW images. +# @exclusive: Use exclusive lock for RW images, and shared lock for RO images. +# +# Since: 2.7 +## +{ 'enum': 'BlockdevLockMode', + 'data': [ 'off', 'shared', 'exclusive' ] } + +## # @BlockdevOptions # # Options for creating a block device. Many options are available for all @@ -2065,6 +2080,8 @@ # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1) # (default: off) # +# @lock-mode: #optional how to lock the image. (default: exclusive) (Since 2.7) +# # Remaining options are determined by the block driver. # # Since: 1.7 @@ -2082,7 +2099,8 @@ '*stats-account-invalid': 'bool', '*stats-account-failed': 'bool', '*stats-intervals': ['int'], - '*detect-zeroes': 'BlockdevDetectZeroesOptions' }, + '*detect-zeroes': 'BlockdevDetectZeroesOptions', + '*lock-mode': 'BlockdevLockMode' }, 'discriminator': 'driver', 'data': { 'archipelago':'BlockdevOptionsArchipelago', -- 2.8.2