From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEzBY-0000xA-RC for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:24:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEzBX-0006Ko-SW for qemu-devel@nongnu.org; Mon, 20 Jun 2016 09:24:16 -0400 Date: Mon, 20 Jun 2016 15:24:06 +0200 From: Kevin Wolf Message-ID: <20160620132406.GA5652@noname.redhat.com> References: <1464943756-14143-1-git-send-email-famz@redhat.com> <1464943756-14143-3-git-send-email-famz@redhat.com> <20160617091748.GB5431@noname.redhat.com> <20160618111611.GA12176@ad.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160618111611.GA12176@ad.usersys.redhat.com> Subject: Re: [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: Fam Zheng Cc: qemu-devel@nongnu.org, 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 Am 18.06.2016 um 13:16 hat Fam Zheng geschrieben: > On Fri, 06/17 11:17, Kevin Wolf wrote: > > Am 03.06.2016 um 10:48 hat Fam Zheng geschrieben: > > > 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. > > > > This feels odd. If I request 'exclusive', I want to have exclusive. > > Reasons may include that I anticipate reopening the image r/w later for > > a commit operation and don't want to have this blocked by other readers. > > > > I see where you're coming from, though, because this might not be a good > > default. Perhaps we need to have both then, an 'exclusive' option that > > does what it promises and a 'default' option that infers the wanted > > locking mode from the writability of the image. > > Fair enough, though I'd call it "auto" instead of "default", what do you think? Agreed, that's a better name. Kevin