From: Kevin Wolf <kwolf@redhat.com>
To: Jeff Cody <jcody@redhat.com>
Cc: "Benoît Canet" <benoit.canet@irqsave.net>,
famz@redhat.com, "Benoît Canet" <benoit@irqsave.net>,
qemu-devel@nongnu.org, armbru@redhat.com, mreitz@redhat.com,
stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH V6 5/8] block: Create authorizations mechanism for external snapshot and resize.
Date: Tue, 4 Feb 2014 11:25:52 +0100 [thread overview]
Message-ID: <20140204102551.GD3384@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <20140204001503.GA29994@localhost.localdomain>
Am 04.02.2014 um 01:15 hat Jeff Cody geschrieben:
> On Thu, Jan 23, 2014 at 09:31:36PM +0100, Benoît Canet wrote:
> > From: Benoît Canet <benoit@irqsave.net>
> >
> > Signed-off-by: Benoit Canet <benoit@irqsave.net>
> > ---
> > block.c | 65 ++++++++++++++++++++++++++++++++++++++++-------
> > block/blkverify.c | 2 +-
> > blockdev.c | 2 +-
> > include/block/block.h | 20 +++++++--------
> > include/block/block_int.h | 12 ++++++---
> > 5 files changed, 77 insertions(+), 24 deletions(-)
> >
> > diff --git a/block.c b/block.c
> > index e1bc732..3e0994b 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -5088,21 +5088,68 @@ int bdrv_amend_options(BlockDriverState *bs, QEMUOptionParameter *options)
> > return bs->drv->bdrv_amend_options(bs, options);
> > }
> >
> > -ExtSnapshotPerm bdrv_check_ext_snapshot(BlockDriverState *bs)
> > +/* Used to recurse on single child block filters.
> > + * Single child block filter will store their child in bs->file.
> > + */
> > +bool bdrv_generic_is_first_non_filter(BlockDriverState *bs,
> > + BlockDriverState *candidate)
> > {
> > - if (bs->drv->bdrv_check_ext_snapshot) {
> > - return bs->drv->bdrv_check_ext_snapshot(bs);
> > + if (!bs->drv) {
> > + return false;
> > + }
> > +
> > + if (!bs->drv->authorizations[BS_IS_A_FILTER]) {
> > + if (bs == candidate) {
> > + return true;
> > + } else {
> > + return false;
> > + }
>
> This seems to break external snapshots; after this patch, I can no
> longer perform live ext snapshots (on qcow2, raw, etc..), unless I am
> doing something incorrectly.
>
> Instead of checking for bs == candidate, was it intended to check to
> see if !strcmp(bs->filename, candidiate->filename) was true?
If believe the problem is in bdrv_is_first_non_filter(): It starts with
bs->file, whereas the first non-filter is obviously the top-level BDS
itself. I suspect the following patch fixes it (it makes the simple
snapshotting case work again, but I'm not sure if it forbids everything
that should be forbidden).
In any case, this shows that...
- ...our testing is still lacking (no qemu-iotests case for live
snapshots? Seriously? Expect it to be broken then.)
- ...not all patch authors do a good share of manual testing
- ...I have relaxed my reviewing too much. I wasn't convinced that this
patch is right, because the whole logic confused me, but I couldn't
point to a bug. I shouldn't have merged it when in doubt.
Jeff, would you like to submit a qemu-iotests case for snapshotting?
Benoît, can you check whether the patch below is correct?
Kevin
diff --git a/block.c b/block.c
index ac0ccac..1299484 100644
--- a/block.c
+++ b/block.c
@@ -5412,11 +5412,7 @@ bool bdrv_is_first_non_filter(BlockDriverState *candidate)
QTAILQ_FOREACH(bs, &bdrv_states, device_list) {
bool perm;
- if (!bs->file) {
- continue;
- }
-
- perm = bdrv_recurse_is_first_non_filter(bs->file, candidate);
+ perm = bdrv_recurse_is_first_non_filter(bs, candidate);
/* candidate is the first non filter */
if (perm) {
next prev parent reply other threads:[~2014-02-04 10:26 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 20:31 [Qemu-devel] [PATCH V6 0/8] Giving names to graph's BlockDriverState Benoît Canet
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 1/8] block: Add bs->node_name to hold the name of a bs node of the bs graph Benoît Canet
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 2/8] block: Allow the user to define "node-name" option both on command line and QMP Benoît Canet
2014-01-24 14:51 ` Benoît Canet
2014-01-24 15:10 ` Kevin Wolf
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 3/8] qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes Benoît Canet
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 4/8] qmp: Allow to change password on named block driver states Benoît Canet
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 5/8] block: Create authorizations mechanism for external snapshot and resize Benoît Canet
2014-02-04 0:15 ` Jeff Cody
2014-02-04 10:25 ` Kevin Wolf [this message]
2014-02-04 13:03 ` Jeff Cody
2014-02-10 19:39 ` Benoît Canet
2014-02-10 19:45 ` Benoît Canet
2014-02-10 20:18 ` Benoît Canet
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 6/8] qmp: Allow block_resize to manipulate bs graph nodes Benoît Canet
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 7/8] qmp: Allow to take external snapshots on bs graphs node Benoît Canet
2014-01-23 20:31 ` [Qemu-devel] [PATCH V6 8/8] block: Use graph node name as reference in bdrv_file_open() Benoît Canet
2014-01-24 13:26 ` Kevin Wolf
2014-01-24 13:37 ` Max Reitz
2014-01-24 14:48 ` Kevin Wolf
2014-01-24 14:54 ` Max Reitz
2014-01-27 14:36 ` Benoît Canet
2014-01-27 19:11 ` Max Reitz
2014-01-28 0:04 ` Benoît Canet
2014-01-31 20:32 ` Max Reitz
2014-01-31 21:37 ` Benoît Canet
2014-02-03 9:43 ` Kevin Wolf
2014-02-04 13:02 ` Eric Blake
2014-01-24 13:27 ` [Qemu-devel] [PATCH V6 0/8] Giving names to graph's BlockDriverState 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=20140204102551.GD3384@dhcp-200-207.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=benoit.canet@irqsave.net \
--cc=benoit@irqsave.net \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=mreitz@redhat.com \
--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).