From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZctdR-0000tT-Oi for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZctdN-0003n0-HE for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:15:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZctdN-0003mu-AB for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:15:17 -0400 References: <1441611277-24596-1-git-send-email-famz@redhat.com> <1441611277-24596-10-git-send-email-famz@redhat.com> <55F322DE.2010508@redhat.com> <55FBF107.4000902@redhat.com> From: Max Reitz Message-ID: <55FBF240.1040608@redhat.com> Date: Fri, 18 Sep 2015 13:15:12 +0200 MIME-Version: 1.0 In-Reply-To: <55FBF107.4000902@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qQkfHAhnbqEg8WhkgJpQBAUt12FX9w41E" Subject: Re: [Qemu-devel] [PATCH v5 09/14] block: Add block job transactions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , vsementsov@parallels.com, stefanha@redhat.com, John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qQkfHAhnbqEg8WhkgJpQBAUt12FX9w41E Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 18.09.2015 13:09, Max Reitz wrote: > On 11.09.2015 20:52, Max Reitz wrote: >> On 07.09.2015 09:34, Fam Zheng wrote: >>> Sometimes block jobs must execute as a transaction group. Finishing >>> jobs wait until all other jobs are ready to complete successfully. >>> Failure or cancellation of one job cancels the other jobs in the grou= p. >>> >>> Signed-off-by: Stefan Hajnoczi >>> [Rewrite the implementation which is now contained in block_job_compl= eted. >>> --Fam] >>> Signed-off-by: Fam Zheng >>> --- >>> blockjob.c | 134 +++++++++++++++++++++++++++++++++++++= +++++++++- >>> include/block/block.h | 1 + >>> include/block/blockjob.h | 38 ++++++++++++++ >>> 3 files changed, 171 insertions(+), 2 deletions(-) >>> >=20 > [...] >=20 >>> diff --git a/include/block/blockjob.h b/include/block/blockjob.h >>> index f6e4c86..0a6c138 100644 >>> --- a/include/block/blockjob.h >>> +++ b/include/block/blockjob.h >=20 > [...] >=20 >>> @@ -395,4 +398,39 @@ void block_job_defer_to_main_loop(BlockJob *job,= >=20 > [...] >=20 >>> + >>> +/** >>> + * block_job_txn_add_job: >>> + * @txn: The transaction (may be NULL) >>> + * @job: Job to add to the transaction >>> + * >>> + * Add @job to the transaction. The @job must not already be in a t= ransaction. >>> + * The block job driver must call block_job_txn_prepare_to_complete(= ) before >>> + * final cleanup and completion. >=20 > To me that sounds a bit as if this should be called e.g. in > block/backup.c:backup_complete(). Maybe add that this is called > automatically by block_job_completed()? >=20 > Either way: >=20 > Reviewed-by: Max Reitz Oops, wrong version. And I didn't even read the comment again, which would have showed that to me. Please-ignore: Max Reitz >>> + */ >>> +void block_job_txn_add_job(BlockJobTxn *txn, BlockJob *job); >>> + >>> #endif >=20 --qQkfHAhnbqEg8WhkgJpQBAUt12FX9w41E Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJV+/JAAAoJEDuxQgLoOKytAJQIAJK4d61RPfprSaeFEQ+eKBsi 9n5RWaRHTSZDwL3KrfWLwbQFN9fv71BLMbU6L29ie30fOQbP9myBHeXJWLlnwMCP jnyPhvoIpMr+CN05r5rIpbHxY5iVMSw2CT6bFaJw1P07OyxkJB0CFDRjEeeog4cC sD0SRh5lyjAeJfAeH3B9xNxTSBZ3d26qqz0sANyF38ejz+v/iCbRWGtZzysyFolX mkkewIHYONMamT1PZSVYobTOlpCswN0pxnZRH0ZXV4Woo93k7OrLwIhlX48HLjCw 3YFlmIF3FD3YYslMkPvsTk7I8NajsZQH3FnjIUjnk8q26DzOK9DO8ZIfJ+F3Di4= =1/h1 -----END PGP SIGNATURE----- --qQkfHAhnbqEg8WhkgJpQBAUt12FX9w41E--