From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDlKQ-0007en-9V for qemu-devel@nongnu.org; Wed, 12 Feb 2014 20:43:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDlKK-0004Ra-Jv for qemu-devel@nongnu.org; Wed, 12 Feb 2014 20:43:02 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:49872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDlKK-0004RF-3n for qemu-devel@nongnu.org; Wed, 12 Feb 2014 20:42:56 -0500 Date: Thu, 13 Feb 2014 02:42:54 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140213014254.GE16184@irqsave.net> References: <1392068957-14184-1-git-send-email-benoit.canet@irqsave.net> <1392068957-14184-2-git-send-email-benoit.canet@irqsave.net> <20140211081217.GB12675@T430.nay.redhat.com> <20140212194918.GC4225@irqsave.net> <20140212214315.GA10146@irqsave.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20140212214315.GA10146@irqsave.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [FIX V2] block: Fix device snapshots broken by the block filter snapshots patchset. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Beno=EEt?= Canet Cc: kwolf@redhat.com, Fam Zheng , armbru@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com The Wednesday 12 Feb 2014 =E0 22:43:15 (+0100), Beno=EEt Canet wrote : > The Wednesday 12 Feb 2014 =E0 20:49:18 (+0100), Beno=EEt Canet wrote : > > The Tuesday 11 Feb 2014 =E0 16:12:17 (+0800), Fam Zheng wrote : > > > On Mon, 02/10 22:49, Beno=EEt Canet wrote: > > > > Take into account the fact that a block filter like quorum will b= e in bs->file > > > > while a regular block driver device is really on the top level. > > > >=20 > > > > Signed-off-by: Benoit Canet > > > > --- > > > > block.c | 14 ++++++++------ > > > > 1 file changed, 8 insertions(+), 6 deletions(-) > > > >=20 > > > > 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(BlockDriver= State *candidate) > > > > =20 > > > > /* walk down the bs forest recursively */ > > > > QTAILQ_FOREACH(bs, &bdrv_states, device_list) { > > > > - bool perm; > > > > - > > > > - if (!bs->file) { > > > > - continue; > > > > + bool perm =3D false; > > > > + > > > > + if (bs->file && > > > > + bs->file->drv && > > > > + bs->file->drv->authorizations[BS_IS_A_FILTER]) { > > > > + perm =3D bdrv_recurse_is_first_non_filter(bs->file, = candidate); > > > > + } else if (bs =3D=3D candidate) { > > > > + perm =3D true; > > > > } > > > > =20 > > > > - perm =3D bdrv_recurse_is_first_non_filter(bs->file, cand= idate); > > > > - > > > > /* candidate is the first non filter */ > > > > if (perm) { > > > > return true; > > >=20 > > > With this change, if the top level driver has ->file, its implement= ation of > > > .bdrv_recurse_is_first_non_filter() is skipped and bs->file is the = start point. > > >=20 > > > So we have an implication that single child block drivers (that has= ->file) > > > doesn't need to, and shouldn't implement this operation, as comment= ted above > > > bdrv_generic_is_first_non_filter. > > >=20 > > > Tested that this patch fixes the external snapshot problem, but did= n't test > > > the "quorum as bs->file case". > > >=20 > > > Thanks, > > >=20 > > > Reviewed-by: Fam Zheng > >=20 > > After extensive testing of all type of quorum instanciations and snap= shots I > > discovered that we are not done yet with this issue. > >=20 > > 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 quor= um driver > > is in bs->drv. > >=20 > > As a result this patch work in half the cases: regular file and comma= nd line > > quorum but not when quorum is instantiated via QMP. > >=20 > > I don't understand why the block layer have this irregular behavior r= egarding > > quorum instantiation. > >=20 > > What would be the best way to fix this ? >=20 > I have a pending resping of this patch which tests for the two cases as= a > workaround. >=20 > Should I post it ? >=20 > Best regards >=20 > Beno=EEt >=20 > >=20 > > Best regards > >=20 > > Beno=EEt > >=20 >=20 I found that the used the command line init in a wrong way. I will repost an updated version of the patch. Quorum will need to be reposted since one commit message showed the wrong= way of doing the initialization. Best regards Beno=EEt