Received: from eggs.gnu.org ([2001:4830:134:3::10]:54836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8knW-0006dU-HD for qemu-devel@nongnu.org; Fri, 03 Jun 2016 04:49:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8knV-0001p9-HI for qemu-devel@nongnu.org; Fri, 03 Jun 2016 04:49:42 -0400 From: Fam Zheng Date: Fri, 3 Jun 2016 16:48:56 +0800 Message-Id: <1464943756-14143-3-git-send-email-famz@redhat.com> In-Reply-To: <1464943756-14143-1-git-send-email-famz@redhat.com> References: <1464943756-14143-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v6 02/22] 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 , qemu-block@nongnu.org, rjones@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, John Snow , berrange@redhat.com, den@openvz.org 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 98a20d2..23ec31d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2032,6 +2032,20 @@ '*read-pattern': 'QuorumReadPattern' } } ## +# @BlockdevLockMode +# +# Describes how QEMU should lock the image. +# +# @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 +2079,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 +2098,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