qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@irqsave.net>
To: Fam Zheng <famz@redhat.com>
Cc: "Benoît Canet" <benoit.canet@irqsave.net>,
	kwolf@redhat.com, armbru@redhat.com, jcody@redhat.com,
	qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [FIX V2] block: Fix device snapshots broken by the block filter snapshots patchset.
Date: Wed, 12 Feb 2014 20:49:18 +0100	[thread overview]
Message-ID: <20140212194918.GC4225@irqsave.net> (raw)
In-Reply-To: <20140211081217.GB12675@T430.nay.redhat.com>

The Tuesday 11 Feb 2014 à 16:12:17 (+0800), Fam Zheng wrote :
> On Mon, 02/10 22:49, Benoît Canet wrote:
> > Take into account the fact that a block filter like quorum will be in bs->file
> > while a regular block driver device is really on the top level.
> > 
> > Signed-off-by: Benoit Canet <benoit@irqsave.net>
> > ---
> >  block.c | 14 ++++++++------
> >  1 file changed, 8 insertions(+), 6 deletions(-)
> > 
> > diff --git a/block.c b/block.c
> > index 07ac50a..d04f535 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -5400,14 +5400,16 @@ bool bdrv_is_first_non_filter(BlockDriverState *candidate)
> >  
> >      /* walk down the bs forest recursively */
> >      QTAILQ_FOREACH(bs, &bdrv_states, device_list) {
> > -        bool perm;
> > -
> > -        if (!bs->file) {
> > -            continue;
> > +        bool perm = false;
> > +
> > +        if (bs->file &&
> > +            bs->file->drv &&
> > +            bs->file->drv->authorizations[BS_IS_A_FILTER]) {
> > +            perm = bdrv_recurse_is_first_non_filter(bs->file, candidate);
> > +        } else if (bs == candidate) {
> > +            perm = true;
> >          }
> >  
> > -        perm = bdrv_recurse_is_first_non_filter(bs->file, candidate);
> > -
> >          /* candidate is the first non filter */
> >          if (perm) {
> >              return true;
> 
> With this change, if the top level driver has ->file, its implementation of
> .bdrv_recurse_is_first_non_filter() is skipped and bs->file is the start point.
> 
> So we have an implication that single child block drivers (that has ->file)
> doesn't need to, and shouldn't implement this operation, as commentted above
> bdrv_generic_is_first_non_filter.
> 
> Tested that this patch fixes the external snapshot problem, but didn't test
> the "quorum as bs->file case".
> 
> Thanks,
> 
> Reviewed-by: Fam Zheng <famz@redhat.com>

After extensive testing of all type of quorum instanciations and snapshots I
discovered that we are not done yet with this issue.

When instantiating quorum from the command line the quorum driver is in
bs->file->drv.
When using QMP's blockdev_add at once or by using references the quorum driver
is in bs->drv.

As a result this patch work in half the cases: regular file and command line
quorum but not when quorum is instantiated via QMP.

I don't understand why the block layer have this irregular behavior regarding
quorum instantiation.

What would be the best way to fix this ?

Best regards

Benoît

  reply	other threads:[~2014-02-12 19:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-10 21:49 [Qemu-devel] [FIX V2] Fix broken external snapshots Benoît Canet
2014-02-10 21:49 ` [Qemu-devel] [FIX V2] block: Fix device snapshots broken by the block filter snapshots patchset Benoît Canet
2014-02-11  8:12   ` Fam Zheng
2014-02-12 19:49     ` Benoît Canet [this message]
2014-02-12 21:43       ` Benoît Canet
2014-02-13  1:42         ` Benoît Canet
2014-02-13  8:27       ` Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2014-02-13  1:51 [Qemu-devel] [FIX V2] repair snapshots Benoît Canet
2014-02-13  1:51 ` [Qemu-devel] [FIX V2] block: Fix device snapshots broken by the block filter snapshots patchset Benoît Canet
2014-02-13  8:33   ` Kevin Wolf
2014-02-13  8:44     ` Benoît Canet

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=20140212194918.GC4225@irqsave.net \
    --to=benoit.canet@irqsave.net \
    --cc=armbru@redhat.com \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@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).