From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaTPM-0001XF-QC for qemu-devel@nongnu.org; Fri, 11 Sep 2015 14:50:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaTPJ-0005BX-7n for qemu-devel@nongnu.org; Fri, 11 Sep 2015 14:50:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaTPJ-0005BC-0B for qemu-devel@nongnu.org; Fri, 11 Sep 2015 14:50:45 -0400 References: <1441611277-24596-1-git-send-email-famz@redhat.com> <1441611277-24596-12-git-send-email-famz@redhat.com> From: Max Reitz Message-ID: <55F3227F.8000908@redhat.com> Date: Fri, 11 Sep 2015 20:50:39 +0200 MIME-Version: 1.0 In-Reply-To: <1441611277-24596-12-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cPgwcBhlnMQdkMIGlQj8NnrDexWPxUMkd" Subject: Re: [Qemu-devel] [PATCH v5 11/14] block/backup: support 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) --cPgwcBhlnMQdkMIGlQj8NnrDexWPxUMkd Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 07.09.2015 09:34, Fam Zheng wrote: > From: Stefan Hajnoczi >=20 > Join the transaction when the 'transactional-cancel' QMP argument is > true. >=20 > This ensures that the sync bitmap is not thrown away if another block > job in the transaction is cancelled or fails. This is critical so > incremental backup with multiple disks can be retried in case of > cancellation/failure. >=20 > Signed-off-by: Stefan Hajnoczi > Signed-off-by: Fam Zheng > --- > block/backup.c | 25 +++++++-- > blockdev.c | 139 ++++++++++++++++++++++++++++++++++++--= -------- > hmp.c | 2 +- > include/block/block_int.h | 3 +- > qapi/block-core.json | 16 +++++- > 5 files changed, 148 insertions(+), 37 deletions(-) >=20 > diff --git a/block/backup.c b/block/backup.c > index 9776d9c..3a3dccc 100644 > --- a/block/backup.c > +++ b/block/backup.c [snip] > @@ -545,6 +559,7 @@ void backup_start(BlockDriverState *bs, BlockDriver= State *target, > sync_bitmap : NULL; > job->common.len =3D len; > job->common.co =3D qemu_coroutine_create(backup_run); > + block_job_txn_add_job(txn, &job->common); You're calling this for every single job, so the reference count of txn will probably be job count + 1. However, block_job_txn_unref() is only called for one block job by block_job_completed_txn_{abort,success}(). I think you need to call block_job_txn_unref() for every completed block job, otherwise it will be leaked if there is more than a single job in the txn. Max > qemu_coroutine_enter(job->common.co, job); > return; >=20 --cPgwcBhlnMQdkMIGlQj8NnrDexWPxUMkd 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 iQEcBAEBCAAGBQJV8yJ/AAoJEDuxQgLoOKytb/UH/RpuR4kf5yBXodaaN7q3GMsJ ycpmKCB7tdMnaSFoua+NkmWO5JhjhwP5JikuVdnZ0McWccVI8Rc0OMyqoMJAaZtR yyPwTlHWyFoVnoJtIrAWQ5LUvkc0JhR6JPsYcVaVWizAUMVBmfEnNwu64UTc8chA jWGG9WmK/fPluD8cn/Aoj9dVYunOzrLbfg8yLLkyfmfAzwzqTJZUfHBxDN99zVft U9ekmxG7TGsRefYEmqKuR4Ybr+Awdp+oVlbZuLXGoIgQDbaRnyha6K0PMBzDHRgN rdBwUhTiA8O0RxMV1BYKRzVoEIOBCAdmlL0cIcbucAr/YZ1hWs9UaG3FFAS5jd8= =4zgP -----END PGP SIGNATURE----- --cPgwcBhlnMQdkMIGlQj8NnrDexWPxUMkd--