From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arQaz-0005uA-JD for qemu-devel@nongnu.org; Sat, 16 Apr 2016 09:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arQay-0005gw-OA for qemu-devel@nongnu.org; Sat, 16 Apr 2016 09:49:09 -0400 References: <1460690887-32751-1-git-send-email-famz@redhat.com> <1460690887-32751-4-git-send-email-famz@redhat.com> From: "Denis V. Lunev" Message-ID: <57123ADA.8060104@openvz.org> Date: Sat, 16 Apr 2016 16:15:06 +0300 MIME-Version: 1.0 In-Reply-To: <1460690887-32751-4-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 03/17] blockdev: Add and parse "lock-image" option for block devices 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: > Honor the locking switch specified in CLI or QMP, and set the open flags for > the image accordingly. > > Signed-off-by: Fam Zheng > --- > blockdev.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/blockdev.c b/blockdev.c > index f1f520a..93bd43e 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -382,6 +382,10 @@ static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags, > return; > } > } > + > + if (!qemu_opt_get_bool(opts, "lock-image", false)) { > + *bdrv_flags |= BDRV_O_NO_LOCK; > + } > } > > /* disk I/O throttling */ > @@ -4249,6 +4253,10 @@ QemuOptsList qemu_common_drive_opts = { > .type = QEMU_OPT_BOOL, > .help = "whether to account for failed I/O operations " > "in the statistics", > + },{ > + .name = "lock-image", > + .type = QEMU_OPT_BOOL, > + .help = "whether to lock the image (default: on)", > }, > { /* end of list */ } > }, should you add proper clause into qmp-commands.hx?