From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZctYP-0007TE-8P for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:10:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZctYL-0001Ie-UA for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:10:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZctYL-0001FU-Pp for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:10:05 -0400 References: <1441611277-24596-1-git-send-email-famz@redhat.com> <1441611277-24596-10-git-send-email-famz@redhat.com> <55F322DE.2010508@redhat.com> From: Max Reitz Message-ID: <55FBF107.4000902@redhat.com> Date: Fri, 18 Sep 2015 13:09:59 +0200 MIME-Version: 1.0 In-Reply-To: <55F322DE.2010508@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jetd2vmQXSxRkJUfgxkl7K6nRqnJiflKK" 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) --jetd2vmQXSxRkJUfgxkl7K6nRqnJiflKK Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable 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 group= =2E >> >> Signed-off-by: Stefan Hajnoczi >> [Rewrite the implementation which is now contained in block_job_comple= ted. >> --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(-) >> [...] >> 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 [...] >> @@ -395,4 +398,39 @@ void block_job_defer_to_main_loop(BlockJob *job, [...] >> + >> +/** >> + * 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 tr= ansaction. >> + * The block job driver must call block_job_txn_prepare_to_complete()= before >> + * final cleanup and completion. 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()? Either way: Reviewed-by: Max Reitz >> + */ >> +void block_job_txn_add_job(BlockJobTxn *txn, BlockJob *job); >> + >> #endif --jetd2vmQXSxRkJUfgxkl7K6nRqnJiflKK 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+/EHAAoJEDuxQgLoOKytwl0H/AqhD0RrbZdgbrqroXDcRLuQ tn54uGELP9Vwz3vvPYz9ta0vCVtRHqZbwByQ6XIB05g7JhMH6tK5+bLEoCZjipG4 HXLNRWIr1sm+JrrCe/e+jfR1bFK/Umg27U7+HVw3Qukt5+5yVum+a4CR0HYymoOQ 2XIQkNpfv/ULjlIrDodiEcTxa2ekZ6vU3u50F5Xm958Kagl//a9wLA/ltzIZqIN9 bzx4Fl+sQPj+KeK2YsjTvVwNuOg+T0UIhRFs2ATOO1xoWkx9mgNpqeyyfAqi1uK4 CWN3MvmeTveQdME6qw/RdiMTo8E0FpEtPLlHJq+EjyOUQP/LBbNcI0Rtj9rhk6U= =ssh5 -----END PGP SIGNATURE----- --jetd2vmQXSxRkJUfgxkl7K6nRqnJiflKK--