From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZExVl-0007r9-7Q for qemu-devel@nongnu.org; Tue, 14 Jul 2015 06:32:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZExVg-0004fO-TA for qemu-devel@nongnu.org; Tue, 14 Jul 2015 06:32:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZExVg-0004f9-Lm for qemu-devel@nongnu.org; Tue, 14 Jul 2015 06:32:24 -0400 Date: Tue, 14 Jul 2015 11:32:22 +0100 From: Stefan Hajnoczi Message-ID: <20150714103222.GG17927@stefanha-thinkpad.redhat.com> References: <1436500012-32593-1-git-send-email-famz@redhat.com> <1436500012-32593-13-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zrag5V6pnZGjLKiw" Content-Disposition: inline In-Reply-To: <1436500012-32593-13-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 12/15] block/backup: support block job transactions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , Jeff Cody , qemu-devel@nongnu.org, Max Reitz , vsementsov@parallels.com, John Snow --Zrag5V6pnZGjLKiw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 10, 2015 at 11:46:49AM +0800, Fam Zheng wrote: > static BlockErrorAction backup_error_action(BackupBlockJob *job, > @@ -444,7 +462,7 @@ static void coroutine_fn backup_run(void *opaque) > qemu_co_rwlock_wrlock(&job->flush_rwlock); > qemu_co_rwlock_unlock(&job->flush_rwlock); > =20 > - if (job->sync_bitmap) { > + if (!job->common.txn && job->sync_bitmap) { > backup_handle_dirty_bitmap(job, ret); > } > hbitmap_free(job->bitmap); It would be nice if the core blockjob code called commit/abort even when there is no txn object. That way we can avoid special case code > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 7b2efb8..d5e33fd 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -736,6 +736,10 @@ > # default 'report' (no limitations, since this applies= to > # a different block device than @device). > # > +# @transactional-cancel: #optional whether failure or cancellation of ot= her > +# block jobs with @transactional-cancel true caus= es the > +# whole group to cancel. > +# > # Note that @on-source-error and @on-target-error only affect background= I/O. > # If an error occurs during a guest write request, the device's rerror/w= error > # actions will be used. > @@ -747,7 +751,8 @@ > 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', > '*speed': 'int', '*bitmap': 'str', > '*on-source-error': 'BlockdevOnError', > - '*on-target-error': 'BlockdevOnError' } } > + '*on-target-error': 'BlockdevOnError', > + '*transactional-cancel': 'bool' } } > =20 > ## > # @BlockdevBackup > @@ -771,6 +776,10 @@ > # default 'report' (no limitations, since this applies= to > # a different block device than @device). > # > +# @transactional-cancel: #optional whether failure or cancellation of ot= her > +# block jobs with @transactional-cancel true caus= es the > +# whole group to cancel. > +# > # Note that @on-source-error and @on-target-error only affect background= I/O. > # If an error occurs during a guest write request, the device's rerror/w= error > # actions will be used. > @@ -782,7 +791,8 @@ > 'sync': 'MirrorSyncMode', > '*speed': 'int', > '*on-source-error': 'BlockdevOnError', > - '*on-target-error': 'BlockdevOnError' } } > + '*on-target-error': 'BlockdevOnError', > + '*transactional-cancel': 'bool' } } The doc comments are missing (Since: 2.5). My fault, sorry! --Zrag5V6pnZGjLKiw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVpOU2AAoJEJykq7OBq3PIq4QH/14Qp1+d28pgYh1X0ueMcQ2R jtJOWM3goflL9PhJ7iwMBt2NuLPokPql6UAWj5hGoxTleVgjqU/Bx2iKAyxndIFh I6DGK6NSLM37gR4SEuYthu/Un0Ld2HP8vVop5rgGxMtzauYTEW4B9vr2Wuog9aPj V5GM39Tj0R7hVmFkyqfQgJp9/gwnecwJMceTfRkH/2ax6YUeXFrlCoPO5x7Dhpea gzWCSfPiuTTwPKNvHs/GgdXBkAJU4cTbjr9B9vp3wblXsT+Ju6sefEoAFNbO5wGD OIpROgD2yMjUW4Jj3kmjno89M124clCk1LP51QntkJiDV56UF28E48Viy46G/f4= =r8Bs -----END PGP SIGNATURE----- --Zrag5V6pnZGjLKiw--