qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, kwolf@redhat.com, qemu-block@nongnu.org,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.10 3/9] block: honor BDRV_O_ALLOW_RDWR when clearing bs->read_only
Date: Wed, 5 Apr 2017 20:55:49 -0400	[thread overview]
Message-ID: <20170406005549.GN1135@localhost.localdomain> (raw)
In-Reply-To: <20170406002028.GK1135@localhost.localdomain>

On Wed, Apr 05, 2017 at 08:20:28PM -0400, Jeff Cody wrote:
> On Wed, Apr 05, 2017 at 02:26:53PM -0500, Eric Blake wrote:
> > On 04/05/2017 02:20 PM, John Snow wrote:
> > 
> > > Conceptually straightforward.
> > > 
> > > looks like this might change behavior for... RBD and vvfat, right?
> > > RBD is the subject of this series so we'll just assume that was broken
> > > and stupid.
> > > 
> 
> Yes on RBD, and that change is intentional.
> 
> > > What's vvfat's story? It always set the read-only property to false
> > > regardless of what you asked for?
> > 
> > vvfat is even stupider than that - it has its own independent property
> > 'rw' that determines whether to allow write operations, separate from
> > the inherited BDS readonly property.
> >
> 
> Yes, it is very odd.  But if we have copy_on_read enabled, or explicitly set
> the block device to read-only via QAPI or -drive, I think that those should
> take precedence.
>

I meant to add an example - currently, with this drive commandline:

"-drive format=vvfat,dir=/tmp/vvfat,rw,if=virtio,readonly=on"

The drive is not read-only, but writable.  That seems broken.

After this patch, this ends up throwing an error now (which I think is a
logical thing to do):

qemu-system-x86_64: -drive format=vvfat,dir=/tmp/vvfat,rw,if=virtio,readonly=on: Node '#block238' is read only

How this affects vvfat (and rbd) should be documented in the commit message,
however, so I should ammend that if we keep this behavior.

One other possible option is to treat the vvfat 'rw' option as meaning
"enable writes, iff the block device is writable".  With that
interpretation, we could do something different in the above scenario:
silently fail to set bs->read_only to 'true' in the vvfat driver, and keep
it r/o.

  reply	other threads:[~2017-04-06  0:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 18:28 [Qemu-devel] [PATCH for-2.10 0/9] RBD reopen, read_only cleanup Jeff Cody
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 1/9] block: add bdrv_set_read_only() helper function Jeff Cody
2017-04-07  9:06   ` Stefan Hajnoczi
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 2/9] block: do not set BDS read_only if copy_on_read enabled Jeff Cody
2017-04-05 19:16   ` John Snow
2017-04-05 23:50     ` Jeff Cody
2017-04-07  9:13   ` Stefan Hajnoczi
2017-04-07  9:45   ` Stefan Hajnoczi
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 3/9] block: honor BDRV_O_ALLOW_RDWR when clearing bs->read_only Jeff Cody
2017-04-05 19:20   ` John Snow
2017-04-05 19:26     ` Eric Blake
2017-04-06  0:20       ` Jeff Cody
2017-04-06  0:55         ` Jeff Cody [this message]
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 4/9] block: code movement Jeff Cody
2017-04-05 20:25   ` John Snow
2017-04-07  9:16   ` Stefan Hajnoczi
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 5/9] block: introduce bdrv_try_set_read_only() Jeff Cody
2017-04-05 20:28   ` John Snow
2017-04-06  0:23     ` Jeff Cody
2017-04-07  9:18       ` Stefan Hajnoczi
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 6/9] block: use bdrv_try_set_read_only() during reopen Jeff Cody
2017-04-05 20:25   ` John Snow
2017-04-06  0:27     ` Jeff Cody
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 7/9] block/rbd - update variable names to more apt names Jeff Cody
2017-04-07  9:47   ` Stefan Hajnoczi
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 8/9] block/rbd: do not blindly set bs->read_only Jeff Cody
2017-04-07  9:52   ` Stefan Hajnoczi
2017-04-05 18:28 ` [Qemu-devel] [PATCH for-2.10 9/9] block/rbd: Add support for reopen() Jeff Cody
2017-04-07  9:53   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170406005549.GN1135@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).