From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCXpM-0004nY-JW for qemu-devel@nongnu.org; Fri, 14 Sep 2012 11:29:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCXpL-0000Wo-EU for qemu-devel@nongnu.org; Fri, 14 Sep 2012 11:29:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCXpL-0000WV-5z for qemu-devel@nongnu.org; Fri, 14 Sep 2012 11:29:07 -0400 Message-ID: <50534BE7.2070803@redhat.com> Date: Fri, 14 Sep 2012 09:23:19 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig4B12B7A8A2A63C0790387200" Subject: Re: [Qemu-devel] [PATCH 1/8] block: add support functions for live commit, to find and delete images. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, supriyak@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4B12B7A8A2A63C0790387200 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/14/2012 07:41 AM, Jeff Cody wrote: > Add bdrv_find_overlay(), and bdrv_drop_intermediate(). >=20 > bdrv_find_overlay(): given 'bs' and the active (topmost) BDS of an ima= ge chain, > find the image that is the immediate top of 'bs' >=20 > bdrv_drop_intermediate(): > Given 3 BDS (active, top, base), delete images abov= e s/delete/drop/ > base up to and including top, and set base to be th= e > parent of top's child node. set base to be the backing file of top's overlay node. >=20 > E.g., this converts: >=20 > bottom <- base <- intermediate <- top <- active >=20 > to >=20 > bottom <- base <- active >=20 > +++ b/block.c > @@ -1713,6 +1713,156 @@ int bdrv_change_backing_file(BlockDriverState *= bs, > return ret; > } > =20 > +/* > + * Finds the image layer immediately to the 'top' of bs. Or even: Finds the image layer in the chain that has 'bs' as its backing file. > +/* > + * Deletes images above 'base' up to and including 'top', and sets the= image s/Deletes/Drops/ > +++ b/block.h > @@ -209,7 +209,10 @@ int bdrv_commit_all(void); > int bdrv_change_backing_file(BlockDriverState *bs, > const char *backing_file, const char *backing_fmt); > void bdrv_register(BlockDriver *bdrv); > - > +int bdrv_drop_intermediate(BlockDriverState *active, BlockDriverState = *top, > + BlockDriverState *base); > +BlockDriverState *bdrv_find_overlay(BlockDriverState *active, > + BlockDriverState *bs); > =20 > typedef struct BdrvCheckResult { Changed from two blank lines to one before the typedef; was that intentional? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig4B12B7A8A2A63C0790387200 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQU0voAAoJEKeha0olJ0Nq8KQIAJ4/Nap9YCAPDNuvmtf2JA+Z umvYl84188SKKeVEZNiYUhkyqrtXfDZyeOwoV9/2lik43IeaoDOPY2VLroehJA7g 5iknccdXA6ovF9+DbKZKL3GpmEJLda7UWIHR5i5KS0wJUvHUUCElc+nRMTmod6Ih McuutHW8XDFdc6TT/TpEZkuF9uKMCC/n1JNSfboKSwzBcKoA/pZsnTe2jyjW2+a7 Ek/x22M/K3ErMG7FXyu7bbhA6akJya0iS6SziqmpXV6YBResxBYm1uICgvBofqjq aASzuGvd6aA2EJ+WOsIlnswAoXfybeNEjiH345LGDPrQkyaxpiG0woLkZpDnTtY= =9QU8 -----END PGP SIGNATURE----- --------------enig4B12B7A8A2A63C0790387200--