[{"id":1763934,"web_url":"http://patchwork.ozlabs.org/comment/1763934/","msgid":"<20170906085902.GH15510@redhat.com>","list_archive_url":null,"date":"2017-09-06T08:59:02","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"The 2.10 versio nis already released. Did you mean that you wanted\nthis in the stable branch ?  If so, then CC qemu-stable@nongnu.org\n\nOn Wed, Sep 06, 2017 at 09:50:06AM +0100, Richard W.M. Jones wrote:\n> Commit 16b48d5d66d2 (\"file-posix: Add 'locking' option\") added this\n> option, but as it was not documented in the -help output it was not\n> easily possible to tell if a particular qemu binary supports it.\n\nNB, nothing should be parsing -help output to look for features\nanymore. Is there really no other way to detect this feature ?\n\n> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>\n> ---\n>  qemu-options.hx | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/qemu-options.hx b/qemu-options.hx\n> index 9f6e2adfff..f8f95eb498 100644\n> --- a/qemu-options.hx\n> +++ b/qemu-options.hx\n> @@ -796,7 +796,7 @@ DEF(\"drive\", HAS_ARG, QEMU_OPTION_drive,\n>      \"       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\\n\"\n>      \"       [,serial=s][,addr=A][,rerror=ignore|stop|report]\\n\"\n>      \"       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\\n\"\n> -    \"       [,readonly=on|off][,copy-on-read=on|off]\\n\"\n> +    \"       [,readonly=on|off][,copy-on-read=on|off][,locking=off|auto|on]\\n\"\n>      \"       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\\n\"\n>      \"       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\\n\"\n>      \"       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\\n\"\n\nReviewed-by: Daniel P. Berrange <berrange@redhat.com>\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnHfY2d97z9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 19:02:45 +1000 (AEST)","from localhost ([::1]:35079 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpWEN-0005qQ-IS\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 05:02:43 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:58305)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dpWB1-0003eU-8O\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 04:59:19 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dpWAv-0000ql-J3\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 04:59:15 -0400","from mx1.redhat.com ([209.132.183.28]:48878)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>)\n\tid 1dpWAv-0000qF-CY; Wed, 06 Sep 2017 04:59:09 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 58C90C0587C6;\n\tWed,  6 Sep 2017 08:59:08 +0000 (UTC)","from redhat.com (unknown [10.42.22.189])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 3E6837BB08;\n\tWed,  6 Sep 2017 08:59:04 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 58C90C0587C6","Date":"Wed, 6 Sep 2017 09:59:02 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"\"Richard W.M. Jones\" <rjones@redhat.com>","Message-ID":"<20170906085902.GH15510@redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170906085006.26983-1-rjones@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tWed, 06 Sep 2017 08:59:08 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"kwolf@redhat.com, famz@redhat.com, qemu-trivial@nongnu.org,\n\tmjt@tls.msk.ru, qemu-devel@nongnu.org, armbru@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763937,"web_url":"http://patchwork.ozlabs.org/comment/1763937/","msgid":"<20170906090424.GA18719@redhat.com>","list_archive_url":null,"date":"2017-09-06T09:04:24","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":3044,"url":"http://patchwork.ozlabs.org/api/people/3044/","name":"Richard W.M. Jones","email":"rjones@redhat.com"},"content":"On Wed, Sep 06, 2017 at 09:59:02AM +0100, Daniel P. Berrange wrote:\n> The 2.10 versio nis already released. Did you mean that you wanted\n> this in the stable branch ?  If so, then CC qemu-stable@nongnu.org\n> \n> On Wed, Sep 06, 2017 at 09:50:06AM +0100, Richard W.M. Jones wrote:\n> > Commit 16b48d5d66d2 (\"file-posix: Add 'locking' option\") added this\n> > option, but as it was not documented in the -help output it was not\n> > easily possible to tell if a particular qemu binary supports it.\n> \n> NB, nothing should be parsing -help output to look for features\n> anymore. Is there really no other way to detect this feature ?\n\nIt can be found from monitor output, but parsing -help output really\nis easier in some cases.  In any case it's good to document it for end users.\n\nRich.\n\n> > Signed-off-by: Richard W.M. Jones <rjones@redhat.com>\n> > ---\n> >  qemu-options.hx | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > \n> > diff --git a/qemu-options.hx b/qemu-options.hx\n> > index 9f6e2adfff..f8f95eb498 100644\n> > --- a/qemu-options.hx\n> > +++ b/qemu-options.hx\n> > @@ -796,7 +796,7 @@ DEF(\"drive\", HAS_ARG, QEMU_OPTION_drive,\n> >      \"       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\\n\"\n> >      \"       [,serial=s][,addr=A][,rerror=ignore|stop|report]\\n\"\n> >      \"       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\\n\"\n> > -    \"       [,readonly=on|off][,copy-on-read=on|off]\\n\"\n> > +    \"       [,readonly=on|off][,copy-on-read=on|off][,locking=off|auto|on]\\n\"\n> >      \"       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\\n\"\n> >      \"       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\\n\"\n> >      \"       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\\n\"\n> \n> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>\n> \n> Regards,\n> Daniel\n> -- \n> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|\n> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|\n> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=rjones@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnHjF31Jtz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 19:05:05 +1000 (AEST)","from localhost ([::1]:35090 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpWGd-0006XF-HS\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 05:05:03 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60097)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1dpWGD-0006X6-Fo\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 05:04:38 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1dpWG5-0003Pg-JQ\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 05:04:37 -0400","from mx1.redhat.com ([209.132.183.28]:39444)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <rjones@redhat.com>)\n\tid 1dpWG5-0003PR-EH; Wed, 06 Sep 2017 05:04:29 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 62E1FC049D7F;\n\tWed,  6 Sep 2017 09:04:28 +0000 (UTC)","from localhost (ovpn-117-64.ams2.redhat.com [10.36.117.64])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 8E6F460BE8;\n\tWed,  6 Sep 2017 09:04:25 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 62E1FC049D7F","Date":"Wed, 6 Sep 2017 10:04:24 +0100","From":"\"Richard W.M. Jones\" <rjones@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170906090424.GA18719@redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>\n\t<20170906085902.GH15510@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906085902.GH15510@redhat.com>","User-Agent":"Mutt/1.5.20 (2009-12-10)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tWed, 06 Sep 2017 09:04:28 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, famz@redhat.com, qemu-trivial@nongnu.org,\n\tmjt@tls.msk.ru, qemu-devel@nongnu.org, armbru@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763957,"web_url":"http://patchwork.ozlabs.org/comment/1763957/","msgid":"<20170906093122.GB18719@redhat.com>","list_archive_url":null,"date":"2017-09-06T09:31:22","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":3044,"url":"http://patchwork.ozlabs.org/api/people/3044/","name":"Richard W.M. Jones","email":"rjones@redhat.com"},"content":"On Wed, Sep 06, 2017 at 09:50:06AM +0100, Richard W.M. Jones wrote:\n> Commit 16b48d5d66d2 (\"file-posix: Add 'locking' option\") added this\n> option, but as it was not documented in the -help output it was not\n> easily possible to tell if a particular qemu binary supports it.\n\nMy apologies, I think this patch is wrong.  I'm going to rethink it.\n\nRich.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=rjones@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnJJp509pz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 19:32:26 +1000 (AEST)","from localhost ([::1]:35160 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpWh6-0005PK-QH\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 05:32:24 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:41589)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1dpWgF-0004yw-Ve\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 05:31:36 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1dpWgB-00060y-3K\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 05:31:31 -0400","from mx1.redhat.com ([209.132.183.28]:54092)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <rjones@redhat.com>)\n\tid 1dpWgA-0005zF-UN; Wed, 06 Sep 2017 05:31:27 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 06FBD4E049;\n\tWed,  6 Sep 2017 09:31:26 +0000 (UTC)","from localhost (ovpn-117-64.ams2.redhat.com [10.36.117.64])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 54E0480F92;\n\tWed,  6 Sep 2017 09:31:23 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 06FBD4E049","Date":"Wed, 6 Sep 2017 10:31:22 +0100","From":"\"Richard W.M. Jones\" <rjones@redhat.com>","To":"qemu-devel@nongnu.org","Message-ID":"<20170906093122.GB18719@redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906085006.26983-1-rjones@redhat.com>","User-Agent":"Mutt/1.5.20 (2009-12-10)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tWed, 06 Sep 2017 09:31:26 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, qemu-trivial@nongnu.org, famz@redhat.com,\n\tmjt@tls.msk.ru, armbru@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763986,"web_url":"http://patchwork.ozlabs.org/comment/1763986/","msgid":"<20170906101905.GD3753@dhcp-200-186.str.redhat.com>","list_archive_url":null,"date":"2017-09-06T10:19:05","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 06.09.2017 um 10:50 hat Richard W.M. Jones geschrieben:\n> Commit 16b48d5d66d2 (\"file-posix: Add 'locking' option\") added this\n> option, but as it was not documented in the -help output it was not\n> easily possible to tell if a particular qemu binary supports it.\n> \n> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>\n> ---\n>  qemu-options.hx | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/qemu-options.hx b/qemu-options.hx\n> index 9f6e2adfff..f8f95eb498 100644\n> --- a/qemu-options.hx\n> +++ b/qemu-options.hx\n> @@ -796,7 +796,7 @@ DEF(\"drive\", HAS_ARG, QEMU_OPTION_drive,\n>      \"       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\\n\"\n>      \"       [,serial=s][,addr=A][,rerror=ignore|stop|report]\\n\"\n>      \"       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\\n\"\n> -    \"       [,readonly=on|off][,copy-on-read=on|off]\\n\"\n> +    \"       [,readonly=on|off][,copy-on-read=on|off][,locking=off|auto|on]\\n\"\n>      \"       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\\n\"\n>      \"       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\\n\"\n>      \"       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\\n\"\n\n'locking' is a driver-specific option and not universally available for\nall images, so it shouldn't be included here.\n\nOf course, you're right that driver-specific options should be\ndocumented somewhere, and currently that's only in the QAPI schema for\nblockdev-add, which isn't quite satisfying. Maybe adding them to the\n'qemu-block-drivers' man page could work (which currently only contains\n'qemu-img create' options).\n\nKevin","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnKMS70dXz9sBd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 20:19:48 +1000 (AEST)","from localhost ([::1]:35262 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpXQx-0007ek-2s\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 06:19:47 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56850)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpXQS-0007eL-As\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 06:19:17 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpXQN-0004Bp-Dl\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 06:19:16 -0400","from mx1.redhat.com ([209.132.183.28]:50738)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>)\n\tid 1dpXQN-0004BK-7q; Wed, 06 Sep 2017 06:19:11 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 147B05F7AC;\n\tWed,  6 Sep 2017 10:19:10 +0000 (UTC)","from dhcp-200-186.str.redhat.com (dhcp-200-186.str.redhat.com\n\t[10.33.200.186])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 64D4B6B56F;\n\tWed,  6 Sep 2017 10:19:06 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 147B05F7AC","Date":"Wed, 6 Sep 2017 12:19:05 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"\"Richard W.M. Jones\" <rjones@redhat.com>","Message-ID":"<20170906101905.GD3753@dhcp-200-186.str.redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906085006.26983-1-rjones@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tWed, 06 Sep 2017 10:19:10 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, mjt@tls.msk.ru, famz@redhat.com,\n\tqemu-devel@nongnu.org, armbru@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763998,"web_url":"http://patchwork.ozlabs.org/comment/1763998/","msgid":"<20170906104451.GM20914@redhat.com>","list_archive_url":null,"date":"2017-09-06T10:44:51","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":3044,"url":"http://patchwork.ozlabs.org/api/people/3044/","name":"Richard W.M. Jones","email":"rjones@redhat.com"},"content":"On Wed, Sep 06, 2017 at 12:19:05PM +0200, Kevin Wolf wrote:\n> Am 06.09.2017 um 10:50 hat Richard W.M. Jones geschrieben:\n> > Commit 16b48d5d66d2 (\"file-posix: Add 'locking' option\") added this\n> > option, but as it was not documented in the -help output it was not\n> > easily possible to tell if a particular qemu binary supports it.\n> > \n> > Signed-off-by: Richard W.M. Jones <rjones@redhat.com>\n> > ---\n> >  qemu-options.hx | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > \n> > diff --git a/qemu-options.hx b/qemu-options.hx\n> > index 9f6e2adfff..f8f95eb498 100644\n> > --- a/qemu-options.hx\n> > +++ b/qemu-options.hx\n> > @@ -796,7 +796,7 @@ DEF(\"drive\", HAS_ARG, QEMU_OPTION_drive,\n> >      \"       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\\n\"\n> >      \"       [,serial=s][,addr=A][,rerror=ignore|stop|report]\\n\"\n> >      \"       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\\n\"\n> > -    \"       [,readonly=on|off][,copy-on-read=on|off]\\n\"\n> > +    \"       [,readonly=on|off][,copy-on-read=on|off][,locking=off|auto|on]\\n\"\n> >      \"       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\\n\"\n> >      \"       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\\n\"\n> >      \"       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\\n\"\n> \n> 'locking' is a driver-specific option and not universally available for\n> all images, so it shouldn't be included here.\n\nIndeed this patch is wrong, please ignore it.\n\nHowever I couldn't work out the incantation to disable locking for a\nqcow2 overlay backed by a file which is locked by another qemu\nprocess:\n\n  ...\n      -drive file=/home/rjones/d/libguestfs/tmp/libguestfsSOXEiU/overlay1,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none \\\n      -device scsi-hd,drive=hd0 \\\n  ...\n  qemu-system-x86_64: -device scsi-hd,drive=hd0: Failed to get shared \"write\" lock\n  Is another process using the image?\n  ...\n\nI'm guessing I need another level of indirection to get to the backing\nfile, but file.file.locking=off did not work either.\n\nI think the error message there is wrong as well since it doesn't\nrefer to the right command line option nor tell you which file is\nlocked.\n\nRich.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=rjones@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnKxC5vgBz9sBd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 20:45:35 +1000 (AEST)","from localhost ([::1]:35345 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpXpt-0005DV-Tw\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 06:45:33 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:36876)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1dpXpN-0005BQ-1D\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 06:45:02 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1dpXpJ-0002U6-3c\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 06:45:01 -0400","from mx1.redhat.com ([209.132.183.28]:43698)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <rjones@redhat.com>)\n\tid 1dpXpI-0002Td-RN; Wed, 06 Sep 2017 06:44:57 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id D34D7356F8;\n\tWed,  6 Sep 2017 10:44:55 +0000 (UTC)","from localhost (ovpn-117-64.ams2.redhat.com [10.36.117.64])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id A14EB5C544;\n\tWed,  6 Sep 2017 10:44:53 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D34D7356F8","Date":"Wed, 6 Sep 2017 11:44:51 +0100","From":"\"Richard W.M. Jones\" <rjones@redhat.com>","To":"Kevin Wolf <kwolf@redhat.com>","Message-ID":"<20170906104451.GM20914@redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>\n\t<20170906101905.GD3753@dhcp-200-186.str.redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906101905.GD3753@dhcp-200-186.str.redhat.com>","User-Agent":"Mutt/1.5.20 (2009-12-10)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tWed, 06 Sep 2017 10:44:56 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, mjt@tls.msk.ru, famz@redhat.com,\n\tqemu-devel@nongnu.org, armbru@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1764040,"web_url":"http://patchwork.ozlabs.org/comment/1764040/","msgid":"<20170906113845.GE3753@dhcp-200-186.str.redhat.com>","list_archive_url":null,"date":"2017-09-06T11:38:45","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 06.09.2017 um 12:44 hat Richard W.M. Jones geschrieben:\n> On Wed, Sep 06, 2017 at 12:19:05PM +0200, Kevin Wolf wrote:\n> > Am 06.09.2017 um 10:50 hat Richard W.M. Jones geschrieben:\n> > > Commit 16b48d5d66d2 (\"file-posix: Add 'locking' option\") added this\n> > > option, but as it was not documented in the -help output it was not\n> > > easily possible to tell if a particular qemu binary supports it.\n> > > \n> > > Signed-off-by: Richard W.M. Jones <rjones@redhat.com>\n> > > ---\n> > >  qemu-options.hx | 2 +-\n> > >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > > \n> > > diff --git a/qemu-options.hx b/qemu-options.hx\n> > > index 9f6e2adfff..f8f95eb498 100644\n> > > --- a/qemu-options.hx\n> > > +++ b/qemu-options.hx\n> > > @@ -796,7 +796,7 @@ DEF(\"drive\", HAS_ARG, QEMU_OPTION_drive,\n> > >      \"       [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\\n\"\n> > >      \"       [,serial=s][,addr=A][,rerror=ignore|stop|report]\\n\"\n> > >      \"       [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\\n\"\n> > > -    \"       [,readonly=on|off][,copy-on-read=on|off]\\n\"\n> > > +    \"       [,readonly=on|off][,copy-on-read=on|off][,locking=off|auto|on]\\n\"\n> > >      \"       [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\\n\"\n> > >      \"       [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\\n\"\n> > >      \"       [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\\n\"\n> > \n> > 'locking' is a driver-specific option and not universally available for\n> > all images, so it shouldn't be included here.\n> \n> Indeed this patch is wrong, please ignore it.\n> \n> However I couldn't work out the incantation to disable locking for a\n> qcow2 overlay backed by a file which is locked by another qemu\n> process:\n> \n>   ...\n>       -drive file=/home/rjones/d/libguestfs/tmp/libguestfsSOXEiU/overlay1,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none \\\n>       -device scsi-hd,drive=hd0 \\\n>   ...\n>   qemu-system-x86_64: -device scsi-hd,drive=hd0: Failed to get shared \"write\" lock\n>   Is another process using the image?\n>   ...\n\nThis command line fragment looks correct to me. For me, it seems to\nwork. I'm starting a first qemu in the background with default locking\noptions:\n\n    $ x86_64-softmmu/qemu-system-x86_64 -hda /tmp/test.qcow2\n\nAnd then starting a second one with a command line resembling yours:\n\n    $ x86_64-softmmu/qemu-system-x86_64 -device virtio-scsi \\\n      -drive file=/tmp/test.qcow2,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none \\\n      -device scsi-hd,drive=hd0\n\nThis works for me. If I set file.locking=auto, it fails as expected, so\nit's not that the locking isn't working for me at all.\n\n> I'm guessing I need another level of indirection to get to the backing\n> file, but file.file.locking=off did not work either.\n\nNo, that would be too much. Without a prefix you configure the qcow2\nlayer, with the 'file.' prefix you configure the file-posix one. There\nis no further nested node.\n\n> I think the error message there is wrong as well since it doesn't\n> refer to the right command line option nor tell you which file is\n> locked.\n\nThis is interesting, I do get -drive in my error message with\nlocking=auto.\n\nI could see how your message makes sense with -blockdev because I think\nthen the image file is really only locked as soon as it is used (and\nonly with the permissions that that user requires), so -device would in\nfact be where it happens and the error message would reflect that. But\nwith -drive, we already request some permissions while opening the\nimage, so I would definitely expect -drive in your error message.\n\nKevin","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnM7Z5jd4z9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Sep 2017 21:39:38 +1000 (AEST)","from localhost ([::1]:35525 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpYgC-0001M5-Rw\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 07:39:36 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56011)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpYfX-0001J7-Gz\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 07:38:58 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpYfS-0002Xl-NO\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 07:38:55 -0400","from mx1.redhat.com ([209.132.183.28]:51633)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>)\n\tid 1dpYfS-0002XP-EJ; Wed, 06 Sep 2017 07:38:50 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 773934E33B;\n\tWed,  6 Sep 2017 11:38:49 +0000 (UTC)","from dhcp-200-186.str.redhat.com (dhcp-200-186.str.redhat.com\n\t[10.33.200.186])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 85AED7BB08;\n\tWed,  6 Sep 2017 11:38:46 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 773934E33B","Date":"Wed, 6 Sep 2017 13:38:45 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"\"Richard W.M. Jones\" <rjones@redhat.com>","Message-ID":"<20170906113845.GE3753@dhcp-200-186.str.redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>\n\t<20170906101905.GD3753@dhcp-200-186.str.redhat.com>\n\t<20170906104451.GM20914@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906104451.GM20914@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tWed, 06 Sep 2017 11:38:49 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, mjt@tls.msk.ru, famz@redhat.com,\n\tqemu-devel@nongnu.org, armbru@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1766830,"web_url":"http://patchwork.ozlabs.org/comment/1766830/","msgid":"<20170912094558.GO20914@redhat.com>","list_archive_url":null,"date":"2017-09-12T09:45:59","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":3044,"url":"http://patchwork.ozlabs.org/api/people/3044/","name":"Richard W.M. Jones","email":"rjones@redhat.com"},"content":"On Wed, Sep 06, 2017 at 01:38:45PM +0200, Kevin Wolf wrote:\n> This command line fragment looks correct to me. For me, it seems to\n> work. I'm starting a first qemu in the background with default locking\n> options:\n> \n>     $ x86_64-softmmu/qemu-system-x86_64 -hda /tmp/test.qcow2\n> \n> And then starting a second one with a command line resembling yours:\n> \n>     $ x86_64-softmmu/qemu-system-x86_64 -device virtio-scsi \\\n>       -drive file=/tmp/test.qcow2,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none \\\n>       -device scsi-hd,drive=hd0\n\nThe problem is with overlays, where file.locking doesn't propagate to\nthe backing file.  Thus:\n\n  $ qemu-system-x86_64 -drive file=backing,format=raw\n\nwhile in another terminal:\n\n  $ qemu-img create -b backing -f qcow2 overlay\n  $ qemu-system-x86_64 -drive file=overlay,format=qcow2,file.locking=off\n  qemu-system-x86_64: Failed to get shared \"write\" lock\n  Is another process using the image?\n\nAfter some experimentation, I came up with this command which works:\n\n  $ qemu-system-x86_64 -drive file.file.filename=overlay,file.driver=qcow2,file.backing.file.locking=off\n\nRich.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=rjones@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs0Lf3BfRz9ryk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 19:46:49 +1000 (AEST)","from localhost ([::1]:34574 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drhmI-00062m-R9\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 05:46:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51989)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1drhli-00062R-9j\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 05:46:11 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1drhlf-000753-6a\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 05:46:10 -0400","from mx1.redhat.com ([209.132.183.28]:47232)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <rjones@redhat.com>)\n\tid 1drhlf-00074T-04; Tue, 12 Sep 2017 05:46:07 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id D0C904E33D;\n\tTue, 12 Sep 2017 09:46:03 +0000 (UTC)","from localhost (ovpn-117-64.ams2.redhat.com [10.36.117.64])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 1EB156E1E7;\n\tTue, 12 Sep 2017 09:45:59 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D0C904E33D","Date":"Tue, 12 Sep 2017 10:45:59 +0100","From":"\"Richard W.M. Jones\" <rjones@redhat.com>","To":"Kevin Wolf <kwolf@redhat.com>","Message-ID":"<20170912094558.GO20914@redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>\n\t<20170906101905.GD3753@dhcp-200-186.str.redhat.com>\n\t<20170906104451.GM20914@redhat.com>\n\t<20170906113845.GE3753@dhcp-200-186.str.redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170906113845.GE3753@dhcp-200-186.str.redhat.com>","User-Agent":"Mutt/1.5.20 (2009-12-10)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tTue, 12 Sep 2017 09:46:04 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, mjt@tls.msk.ru, qemu-devel@nongnu.org,\n\tarmbru@redhat.com, famz@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1766919,"web_url":"http://patchwork.ozlabs.org/comment/1766919/","msgid":"<20170912113205.GG29136@localhost.localdomain>","list_archive_url":null,"date":"2017-09-12T11:32:05","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 12.09.2017 um 11:45 hat Richard W.M. Jones geschrieben:\n> On Wed, Sep 06, 2017 at 01:38:45PM +0200, Kevin Wolf wrote:\n> > This command line fragment looks correct to me. For me, it seems to\n> > work. I'm starting a first qemu in the background with default locking\n> > options:\n> > \n> >     $ x86_64-softmmu/qemu-system-x86_64 -hda /tmp/test.qcow2\n> > \n> > And then starting a second one with a command line resembling yours:\n> > \n> >     $ x86_64-softmmu/qemu-system-x86_64 -device virtio-scsi \\\n> >       -drive file=/tmp/test.qcow2,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none \\\n> >       -device scsi-hd,drive=hd0\n> \n> The problem is with overlays, where file.locking doesn't propagate to\n> the backing file.  Thus:\n> \n>   $ qemu-system-x86_64 -drive file=backing,format=raw\n> \n> while in another terminal:\n> \n>   $ qemu-img create -b backing -f qcow2 overlay\n>   $ qemu-system-x86_64 -drive file=overlay,format=qcow2,file.locking=off\n>   qemu-system-x86_64: Failed to get shared \"write\" lock\n>   Is another process using the image?\n\nlocking=off isn't the right tool for the case. Try this:\n\n$ qemu-system-x86_64 -drive file=overlay,if=none -device virtio-blk-pci,drive=none0,share-rw=on\n\nUnless you're doing really evil things, just telling qemu that your\nguest can cope with concurrent writers to the same image is enough. This\npropagates through the whole chain as appropriate.\n\nKevin","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs2pm0xjvz9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 21:37:52 +1000 (AEST)","from localhost ([::1]:35045 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drjVm-0001ah-7S\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 07:37:50 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54756)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1drjQM-0005lY-KC\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 07:32:15 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1drjQL-0006Q0-NN\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 07:32:14 -0400","from mx1.redhat.com ([209.132.183.28]:47606)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>)\n\tid 1drjQL-0006Ph-HZ; Tue, 12 Sep 2017 07:32:13 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 995663680E;\n\tTue, 12 Sep 2017 11:32:12 +0000 (UTC)","from localhost.localdomain (ovpn-117-138.ams2.redhat.com\n\t[10.36.117.138])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id D598977DD6;\n\tTue, 12 Sep 2017 11:32:06 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 995663680E","Date":"Tue, 12 Sep 2017 13:32:05 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"\"Richard W.M. Jones\" <rjones@redhat.com>","Message-ID":"<20170912113205.GG29136@localhost.localdomain>","References":"<20170906085006.26983-1-rjones@redhat.com>\n\t<20170906101905.GD3753@dhcp-200-186.str.redhat.com>\n\t<20170906104451.GM20914@redhat.com>\n\t<20170906113845.GE3753@dhcp-200-186.str.redhat.com>\n\t<20170912094558.GO20914@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170912094558.GO20914@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tTue, 12 Sep 2017 11:32:12 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, mjt@tls.msk.ru, qemu-devel@nongnu.org,\n\tarmbru@redhat.com, famz@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1766922,"web_url":"http://patchwork.ozlabs.org/comment/1766922/","msgid":"<20170912114344.GQ20914@redhat.com>","list_archive_url":null,"date":"2017-09-12T11:43:44","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":3044,"url":"http://patchwork.ozlabs.org/api/people/3044/","name":"Richard W.M. Jones","email":"rjones@redhat.com"},"content":"On Tue, Sep 12, 2017 at 01:32:05PM +0200, Kevin Wolf wrote:\n> Am 12.09.2017 um 11:45 hat Richard W.M. Jones geschrieben:\n> > On Wed, Sep 06, 2017 at 01:38:45PM +0200, Kevin Wolf wrote:\n> > > This command line fragment looks correct to me. For me, it seems to\n> > > work. I'm starting a first qemu in the background with default locking\n> > > options:\n> > > \n> > >     $ x86_64-softmmu/qemu-system-x86_64 -hda /tmp/test.qcow2\n> > > \n> > > And then starting a second one with a command line resembling yours:\n> > > \n> > >     $ x86_64-softmmu/qemu-system-x86_64 -device virtio-scsi \\\n> > >       -drive file=/tmp/test.qcow2,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none \\\n> > >       -device scsi-hd,drive=hd0\n> > \n> > The problem is with overlays, where file.locking doesn't propagate to\n> > the backing file.  Thus:\n> > \n> >   $ qemu-system-x86_64 -drive file=backing,format=raw\n> > \n> > while in another terminal:\n> > \n> >   $ qemu-img create -b backing -f qcow2 overlay\n> >   $ qemu-system-x86_64 -drive file=overlay,format=qcow2,file.locking=off\n> >   qemu-system-x86_64: Failed to get shared \"write\" lock\n> >   Is another process using the image?\n> \n> locking=off isn't the right tool for the case. Try this:\n> \n> $ qemu-system-x86_64 -drive file=overlay,if=none -device virtio-blk-pci,drive=none0,share-rw=on\n> \n> Unless you're doing really evil things, just telling qemu that your\n> guest can cope with concurrent writers to the same image is enough. This\n> propagates through the whole chain as appropriate.\n\nOur guest certainly *cannot* cope with multiple writers to the backing\ndisk (file \"raw\" in my example).  In fact that would be a disaster.\n\nThe overlay protects the backing disk from ever seeing any writes.\n\nIn our case because the initial qemu instance (which we don't control)\nopened the disk (\"raw\") with an exclusive lock, our only choice for\nmonitoring that disk is to turn off locking.\n\nRich.","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=rjones@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs2yT1PQQz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 21:44:25 +1000 (AEST)","from localhost ([::1]:35062 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drjc2-0003qB-9K\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 07:44:18 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:58240)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1drjbc-0003pk-I8\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 07:43:53 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <rjones@redhat.com>) id 1drjbZ-0002ow-Eo\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 07:43:52 -0400","from mx1.redhat.com ([209.132.183.28]:51692)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <rjones@redhat.com>)\n\tid 1drjbZ-0002oR-5O; Tue, 12 Sep 2017 07:43:49 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id BC5A0C0587D1;\n\tTue, 12 Sep 2017 11:43:47 +0000 (UTC)","from localhost (ovpn-117-64.ams2.redhat.com [10.36.117.64])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 0F6436062A;\n\tTue, 12 Sep 2017 11:43:44 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com BC5A0C0587D1","Date":"Tue, 12 Sep 2017 12:43:44 +0100","From":"\"Richard W.M. Jones\" <rjones@redhat.com>","To":"Kevin Wolf <kwolf@redhat.com>","Message-ID":"<20170912114344.GQ20914@redhat.com>","References":"<20170906085006.26983-1-rjones@redhat.com>\n\t<20170906101905.GD3753@dhcp-200-186.str.redhat.com>\n\t<20170906104451.GM20914@redhat.com>\n\t<20170906113845.GE3753@dhcp-200-186.str.redhat.com>\n\t<20170912094558.GO20914@redhat.com>\n\t<20170912113205.GG29136@localhost.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170912113205.GG29136@localhost.localdomain>","User-Agent":"Mutt/1.5.20 (2009-12-10)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tTue, 12 Sep 2017 11:43:48 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, mjt@tls.msk.ru, qemu-devel@nongnu.org,\n\tarmbru@redhat.com, famz@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1766941,"web_url":"http://patchwork.ozlabs.org/comment/1766941/","msgid":"<20170912122024.GI29136@localhost.localdomain>","list_archive_url":null,"date":"2017-09-12T12:20:24","subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 12.09.2017 um 13:43 hat Richard W.M. Jones geschrieben:\n> On Tue, Sep 12, 2017 at 01:32:05PM +0200, Kevin Wolf wrote:\n> > Am 12.09.2017 um 11:45 hat Richard W.M. Jones geschrieben:\n> > > On Wed, Sep 06, 2017 at 01:38:45PM +0200, Kevin Wolf wrote:\n> > > > This command line fragment looks correct to me. For me, it seems to\n> > > > work. I'm starting a first qemu in the background with default locking\n> > > > options:\n> > > > \n> > > >     $ x86_64-softmmu/qemu-system-x86_64 -hda /tmp/test.qcow2\n> > > > \n> > > > And then starting a second one with a command line resembling yours:\n> > > > \n> > > >     $ x86_64-softmmu/qemu-system-x86_64 -device virtio-scsi \\\n> > > >       -drive file=/tmp/test.qcow2,cache=unsafe,format=qcow2,file.locking=off,id=hd0,if=none \\\n> > > >       -device scsi-hd,drive=hd0\n> > > \n> > > The problem is with overlays, where file.locking doesn't propagate to\n> > > the backing file.  Thus:\n> > > \n> > >   $ qemu-system-x86_64 -drive file=backing,format=raw\n> > > \n> > > while in another terminal:\n> > > \n> > >   $ qemu-img create -b backing -f qcow2 overlay\n> > >   $ qemu-system-x86_64 -drive file=overlay,format=qcow2,file.locking=off\n> > >   qemu-system-x86_64: Failed to get shared \"write\" lock\n> > >   Is another process using the image?\n> > \n> > locking=off isn't the right tool for the case. Try this:\n> > \n> > $ qemu-system-x86_64 -drive file=overlay,if=none -device virtio-blk-pci,drive=none0,share-rw=on\n> > \n> > Unless you're doing really evil things, just telling qemu that your\n> > guest can cope with concurrent writers to the same image is enough. This\n> > propagates through the whole chain as appropriate.\n> \n> Our guest certainly *cannot* cope with multiple writers to the backing\n> disk (file \"raw\" in my example).  In fact that would be a disaster.\n\nYour guest (the libguestfs one with the overlay) can cope with multiple\nwriters to its disk. Or probably it can't, but you treat it as if it\ncould and insist that this is correct enough. Otherwise you wouldn't be\nable to use a raw image that another VM writes to as its backing file.\n\n> The overlay protects the backing disk from ever seeing any writes.\n\nThis is why the backing file is opened read-only and therefore\ncompatible with the initial qemu instance that requires exclusive write\naccess.\n\nThis is all correctly represented in the locking. You wouldn't be able\nto directly use \"raw\" even with share-rw=on because the initial qemu\ninstance doesn't support shared write access. But it works for a backing\nfile.\n\n> In our case because the initial qemu instance (which we don't control)\n> opened the disk (\"raw\") with an exclusive lock, our only choice for\n> monitoring that disk is to turn off locking.\n\nNo, you just need to make sure that the libguestfs instance doesn't\nneed write access to the image of an exclusive writer. Which you already\ndo.\n\nThe only locking problem that you need to solve is that your libguestfs\nVM doesn't forbid other writers to its backing file. And this is exactly\nwhat share-rw=on achieves.\n\nKevin","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=208.118.235.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [208.118.235.17])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs3mv4psJz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 22:21:17 +1000 (AEST)","from localhost ([::1]:35499 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drkBm-0002Us-UV\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 08:21:14 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42576)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1drkBB-0002Tq-Fs\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 08:20:43 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1drkB7-0000Sn-H0\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 08:20:37 -0400","from mx1.redhat.com ([209.132.183.28]:51486)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>)\n\tid 1drkB7-0000Ri-8Z; Tue, 12 Sep 2017 08:20:33 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0C78C4E4C3;\n\tTue, 12 Sep 2017 12:20:32 +0000 (UTC)","from localhost.localdomain (ovpn-117-138.ams2.redhat.com\n\t[10.36.117.138])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 631C777DDA;\n\tTue, 12 Sep 2017 12:20:26 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 0C78C4E4C3","Date":"Tue, 12 Sep 2017 14:20:24 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"\"Richard W.M. Jones\" <rjones@redhat.com>","Message-ID":"<20170912122024.GI29136@localhost.localdomain>","References":"<20170906085006.26983-1-rjones@redhat.com>\n\t<20170906101905.GD3753@dhcp-200-186.str.redhat.com>\n\t<20170906104451.GM20914@redhat.com>\n\t<20170906113845.GE3753@dhcp-200-186.str.redhat.com>\n\t<20170912094558.GO20914@redhat.com>\n\t<20170912113205.GG29136@localhost.localdomain>\n\t<20170912114344.GQ20914@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170912114344.GQ20914@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tTue, 12 Sep 2017 12:20:32 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH for-2.10] qemu-options: Document the -drive\n\tlocking parameter.","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"qemu-trivial@nongnu.org, mjt@tls.msk.ru, qemu-devel@nongnu.org,\n\tarmbru@redhat.com, famz@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]