From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwH4u-0007yI-St for qemu-devel@nongnu.org; Tue, 31 Jul 2012 14:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwH4t-0004Dy-1O for qemu-devel@nongnu.org; Tue, 31 Jul 2012 14:21:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwH4s-0004Bb-O2 for qemu-devel@nongnu.org; Tue, 31 Jul 2012 14:21:54 -0400 Message-ID: <50181B34.4090007@redhat.com> Date: Tue, 31 Jul 2012 11:51:48 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigA8A1610FCD52CDCB2B130433" Subject: Re: [Qemu-devel] [RFC PATCH 2/4] block: add live block commit functionality List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, supriyak@linux.vnet.ibm.com, stefanha@gmail.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA8A1610FCD52CDCB2B130433 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/30/2012 11:16 PM, Jeff Cody wrote: > This adds the live commit coroutine. This iteration focuses on the > commit only below the active layer, and not the active layer itself. >=20 > The behaviour is similar to block streaming; the sectors are walked > through, and anything that exists above 'base' is committed back down > into base. At the end, intermediate images are deleted, and the > chain stiched together. Images are restored to their original open s/stiched/stitched/ > + > +enum { > + /* > + * Size of data buffer for populating the image file. This should= be large > + * enough to process multiple clusters in a single call, so that p= opulating > + * contiguous regions of the image is efficient. > + */ > + COMMIT_BUFFER_SIZE =3D 512 * 1024, /* in bytes */ > +}; Paolo's latest round of patches got to the point of making this configurable for drive-mirror; is that something you should be copying he= re? > +++ b/block_int.h > @@ -342,4 +342,23 @@ void mirror_start(BlockDriverState *bs, BlockDrive= rState *target, > BlockDriverCompletionFunc *cb, > void *opaque, Error **errp); > =20 > +/** > + * commit_start: > + * @bs: Top Block device > + * @base: Block device that will be written into, and become the new t= op > + * @speed: The maximum speed, in bytes per second, or 0 for unlimited.= > + * @on_error: The action to take upon error. Do we need to distinguish between rerror and werror? > + * @cb: Completion function for the job. > + * @opaque: Opaque pointer value passed to @cb. > + * @orig_base_flags: The original open flags for the base image > + * @orig_top_flags: The original open flags for the top image > + * @errp: Error object. > + * > + */ > +void commit_start(BlockDriverState *bs, BlockDriverState *base, > + BlockDriverState *top, int64_t speed, > + BlockdevOnError on_error, BlockDriverCompletionFunc *= cb, > + void *opaque, int orig_base_flags, int orig_top_flags= , > + Error **errp); > + > #endif /* BLOCK_INT_H */ --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigA8A1610FCD52CDCB2B130433 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://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQGBs0AAoJEKeha0olJ0Nq59UH/jO03w/HTBonU5ALaUcneY7+ Kf6YbB6bQv/vz2Y3ABD242lShFAWrXu/mIdzkZNwnUCvsLCK766lkBkJ4E3Mksg4 XFWBrY286twAXNNZhlCYO+JxmU8gAgPauMKmFjQ05ztRUYz20RVHUepNgNJijmVG yGmXKdlYP59xmvULh8kjvZqJSng4T4vbOvBzk4gDUsODfclyL7gU8mh5i4XVWhHV JAcnWDxpr/idos8uDn3xTDzheWMIcBlIIZ8nAEQOIn8BaqFI8vetVNRimFCiAhby DNcziVA9WTglEXODIqm2q9lE+cQCmQZ/VKkhhvYGUEMn7lKg/6JVZKn/EKxGFxg= =yucp -----END PGP SIGNATURE----- --------------enigA8A1610FCD52CDCB2B130433--