From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcteT-0001mt-3G for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:16:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcteP-0004lt-Q4 for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:16:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcteP-0004lN-Ln for qemu-devel@nongnu.org; Fri, 18 Sep 2015 07:16:21 -0400 References: <1442297513-7001-1-git-send-email-famz@redhat.com> <1442297513-7001-10-git-send-email-famz@redhat.com> From: Max Reitz Message-ID: <55FBF281.5040601@redhat.com> Date: Fri, 18 Sep 2015 13:16:17 +0200 MIME-Version: 1.0 In-Reply-To: <1442297513-7001-10-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="X5rtqf6qOQjifDxPSjOGSdiBnudTIxtfs" Subject: Re: [Qemu-devel] [PATCH v6 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) --X5rtqf6qOQjifDxPSjOGSdiBnudTIxtfs Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 15.09.2015 08:11, 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.= >=20 > Signed-off-by: Stefan Hajnoczi > [Rewrite the implementation which is now contained in block_job_complet= ed. > --Fam] > Signed-off-by: Fam Zheng > --- > blockjob.c | 135 +++++++++++++++++++++++++++++++++++++++= +++++++- > include/block/block.h | 1 + > include/block/blockjob.h | 38 +++++++++++++ > 3 files changed, 172 insertions(+), 2 deletions(-) >=20 [...] > diff --git a/include/block/blockjob.h b/include/block/blockjob.h > index f6e4c86..4999682 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 tra= nsaction. > + * The block job driver must call block_job_txn_unref() in the end to = release > + * the reference that is automatically grabbed here. Ah, this looks like I got the right version this time. *cough cough* So, to repeat myself: 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 --X5rtqf6qOQjifDxPSjOGSdiBnudTIxtfs 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+/KBAAoJEDuxQgLoOKyt+4QH/RVWYRm9K7NvzJlGSaF9TBQp AI88EH2jOaA8WvzHRVGutlAWg1xQ0ZfwEyoopvvKY9ggt7SFD+So1tbATeZyuePe 3DQ/22R63SfbZ/l/7RLCTz0Ri8eP4lcziWBMeqwRHHk7kqqbhCaWPo1H0uKhGgeU paPFQQf4fLslfx5xaQA4RYxFR+B/2gdnHmZq/EgAyhZz0B5nxKEi5uT4aQHpv37T 0uf8IXd4HUqtIHEvhMnvRfTi8o013F5//hqOd7gYT5y0J9Rd5FdfWQdBhFAk1srh PR8mC4dfC1zwNTQgF+qcHGM9DG2QczEkuqO7DJdCLJrDkNVJuwL2ROWegXOWlY4= =kjSQ -----END PGP SIGNATURE----- --X5rtqf6qOQjifDxPSjOGSdiBnudTIxtfs--