[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 12/15] block/backup: support block job transa
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 12/15] block/backup: support block job transactions |
Date: |
Tue, 14 Jul 2015 11:32:22 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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);
>
> - 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 other
> +# block jobs with @transactional-cancel true causes
> 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/werror
> # 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' } }
>
> ##
> # @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 other
> +# block jobs with @transactional-cancel true causes
> 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/werror
> # 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!
pgpOy5Smz9lWD.pgp
Description: PGP signature
- Re: [Qemu-devel] [PATCH v3 09/15] blockjob: Move BlockJobDeferToMainLoopData into BlockJob, (continued)
- [Qemu-devel] [PATCH v3 10/15] block: add block job transactions, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 11/15] blockdev: make BlockJobTxn available to qmp 'transaction', Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 12/15] block/backup: support block job transactions, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 13/15] iotests: 124 - transactional failure test, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 14/15] qmp-commands.hx: Update the supported 'transaction' operations, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 15/15] tests: add BlockJobTxn unit test, Fam Zheng, 2015/07/09