From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmTOl-0002Io-OS for qemu-devel@nongnu.org; Mon, 19 May 2014 15:39:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmTOh-00027a-DH for qemu-devel@nongnu.org; Mon, 19 May 2014 15:38:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmTOh-00027W-55 for qemu-devel@nongnu.org; Mon, 19 May 2014 15:38:55 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4JJcrsY015000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 19 May 2014 15:38:54 -0400 Message-ID: <537A5DCC.3030101@redhat.com> Date: Mon, 19 May 2014 13:38:52 -0600 From: Eric Blake MIME-Version: 1.0 References: <1399858555-9672-1-git-send-email-famz@redhat.com> <1399858555-9672-10-git-send-email-famz@redhat.com> In-Reply-To: <1399858555-9672-10-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6Q1hF2C9gd1bgr6TUlLIpSR3EMIRGoalP" Subject: Re: [Qemu-devel] [PATCH v19 09/16] block: Support dropping active in bdrv_drop_intermediate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: kwolf@redhat.com, jcody@redhat.com, hbrock@redhat.com, rjones@redhat.com, armbru@redhat.com, imain@redhat.com, stefanha@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6Q1hF2C9gd1bgr6TUlLIpSR3EMIRGoalP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/11/2014 07:35 PM, Fam Zheng wrote: > Dropping intermediate could be useful both for commit and stream, and > BDS refcnt plus bdrv_swap could do most of the job nicely. It also need= s > to work with op blockers. >=20 > Signed-off-by: Fam Zheng > --- > block.c | 139 ++++++++++++++++++++++++++++---------------------= -------- > block/commit.c | 2 +- > 2 files changed, 70 insertions(+), 71 deletions(-) >=20 > - > /* > - * Drops images above 'base' up to and including 'top', and sets the i= mage > - * above 'top' to have base as its backing file. > + * Drops images above 'base' up to and including 'top', and sets new '= base' as > + * backing_hd of top's overlay (the image orignally has 'top' as backi= ng file). > + * top's overlay may be NULL if 'top' is active, no such update needed= =2E > + * Requires that the top's overlay to 'top' is opened r/w. > + * > + * 1) This will convert the following chain: > + * > + * ... <- base <- ... <- top <- overlay <-... <- active > * > - * Requires that the overlay to 'top' is opened r/w, so that the backi= ng file > - * information in 'bs' can be properly updated. > + * to > + * > + * ... <- base <- overlay <- active Jeff is working on allowing the user full control over the string written into overlay; let's make sure these efforts are coordinated. https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg02949.html > + * > + * 2) It is allowed for bottom=3D=3Dbase, in which case it converts: > * > - * E.g., this will convert the following chain: > - * bottom <- base <- intermediate <- top <- active > + * base <- ... <- top <- overlay <- ... <- active > * > * to > * > - * bottom <- base <- active > + * base <- overlay <- active > * > - * It is allowed for bottom=3D=3Dbase, in which case it converts: > + * 2) It also allows active=3D=3Dtop, in which case it converts: Shouldn't this be 3) ? > * > - * base <- intermediate <- top <- active > + * ... <- base <- ... <- top (active) > * > * to > * > - * base <- active > + * ... <- base =3D=3D active =3D=3D top > + * > + * i.e. only base and lower remains: *top =3D=3D *base when return. > + * > + * 3) If base=3D=3DNULL, it will drop all the BDS below overlay and se= t its and 4) > + * backing_hd to NULL. I.e.: > * > - * Error conditions: > - * if active =3D=3D top, that is considered an error > + * base(NULL) <- ... <- overlay <- ... <- active > + * > + * to > + * > + * overlay <- ... <- active > * > */ --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6Q1hF2C9gd1bgr6TUlLIpSR3EMIRGoalP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTel3MAAoJEKeha0olJ0NqpusIAIaCA2Gjh/XumapGCPEhOcTP Bg+qgJg/o9IdP486jAyBGL4RCFuX7OxUO4AgLxhX19IBSsEeVcjIT/5jGVC2pJl9 zoI1VFvOhj/s5VOg7UdUcQpkTAkCcec6TtbeHSYxKLKzGRrn8cWenhwjwR97bMGH YhidNvgy+3AMjj8oMF144Moy91X82ZPf++m4BYryx4V1lzf3fHW1MtoLmvwtUMBU +KBlxyGsaDtkrjYnWDJwBGPxGEvI02Si8ZO+CY7vM/di2jkWjimfGjEP9BxfqIuO oVKJOjvnnNEOSuKOYmQ8c4lnw3dBunKFA5kybZo3xV/qmB6Bdt7TezNYtcLs4YA= =5T2w -----END PGP SIGNATURE----- --6Q1hF2C9gd1bgr6TUlLIpSR3EMIRGoalP--