From: Kevin Wolf <kwolf@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen
Date: Mon, 18 Sep 2017 14:11:23 +0200 [thread overview]
Message-ID: <20170918121123.GH31915@localhost.localdomain> (raw)
In-Reply-To: <20170918115303.GL15551@lemon.lan>
Am 18.09.2017 um 13:53 hat Fam Zheng geschrieben:
> On Mon, 09/18 10:11, Kevin Wolf wrote:
> > > 2) Don't change the prototypes at all, just change .bdrv_reopen_prepare contract
> > > so that after it returns, .bdrv_child_perm/.bdrv_check_perm should comply to the
> > > new state that would be commited once .bdrv_reopen_commit() is called, or
> > > reverted if .bdrv_reopen_abort().
> >
> > Hm, .bdrv_reopen_prepare already gets the whole queue passed, so I guess
> > this could technically work. I'm not sure if it is a good idea, though.
> >
> > Such a change would still make .bdrv_child_perm depend on the reopen
> > queue, just without actually passing it as a parameter. I like such
> > hidden data flows even less than adding an explicit one.
> >
> > It would also mean that each block driver would have to save the queue
> > in its local bs->opaque structure so that .bdrv_child_perm can access it
> > later. Alternatively, bdrv_reopen_prepare could already store the new
> > cumulative parent permissions, but it would still involve two new fields
> > in bs->opaque for storing something of a rather temporary nature.
>
> What about this?
>
> 1) drv->bdrv_reopen_prepare() saves the desired new perms in
> BDRVReopenState.
But how does it determine the desired new perms? Either you duplicate
the logic of the .bdrv_child_perm implementation into a new set of
functions that does the same thing, but based on the new state; or you
extend the existing function with a BlockReopenQueue parameter. The
latter is basically this series, except with an additional unnecessary
detour through the driver code instead of doing it in common code.
Also note that storing it in BDRVReopenState would have to involve a new
list of an additional data structure because permissions are per
BdrvChild, not per BlockDriverState.
> 2) bdrv_reopen_prepare() checks the new perms after drv->bdrv_reopen_prepare()
> returns.
> 3) bdrv_reopen_commit() updates the bs to new perms.
2) and 3) are already implemented in this series like you suggest.
Kevin
next prev parent reply other threads:[~2017-09-18 12:11 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-15 10:10 [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen Kevin Wolf
2017-09-15 10:10 ` [Qemu-devel] [PATCH 1/6] qemu-io: Reset qemuio_blk permissions before each command Kevin Wolf
2017-09-15 17:44 ` Eric Blake
2017-09-18 7:16 ` Fam Zheng
2017-09-21 13:53 ` Kevin Wolf
2017-09-22 10:46 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-09-22 12:55 ` [Qemu-devel] [PATCH v2 1/6] qemu-io: Drop write permissions before read-only reopen Kevin Wolf
2017-09-22 13:22 ` Fam Zheng
2017-09-15 10:10 ` [Qemu-devel] [PATCH 2/6] block: Add reopen_queue to bdrv_child_perm() Kevin Wolf
2017-09-15 17:51 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 3/6] block: Add reopen queue to bdrv_check_perm() Kevin Wolf
2017-09-15 18:39 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 4/6] block: Base permissions on rw state after reopen Kevin Wolf
2017-09-15 18:58 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 5/6] block: reopen: Queue children after their parents Kevin Wolf
2017-09-15 19:01 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 6/6] block: Fix permissions after bdrv_reopen() Kevin Wolf
2017-09-15 19:06 ` Eric Blake
2017-09-18 9:35 ` Kevin Wolf
2017-09-18 7:37 ` Fam Zheng
2017-09-18 7:43 ` Kevin Wolf
2017-09-15 17:02 ` [Qemu-devel] [PATCH 7/6] qemu-iotests: Test change-backing-file command Kevin Wolf
2017-09-15 19:14 ` Eric Blake
2017-09-18 7:51 ` [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen Fam Zheng
2017-09-18 8:11 ` Kevin Wolf
2017-09-18 11:53 ` Fam Zheng
2017-09-18 12:11 ` Kevin Wolf [this message]
2017-09-18 12:32 ` Fam Zheng
2017-09-20 10:33 ` Kevin Wolf
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=20170918121123.GH31915@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=famz@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.