[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 06/15] blockjob: Add .txn_commit and .txn_abo
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 06/15] blockjob: Add .txn_commit and .txn_abort transaction actions |
Date: |
Tue, 14 Jul 2015 09:35:54 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Jul 10, 2015 at 11:46:43AM +0800, Fam Zheng wrote:
> They will be called if the job is part of a transaction, after all jobs in a
> transaction are completed or cancelled, before calling job->cb().
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> include/block/blockjob.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/block/blockjob.h b/include/block/blockjob.h
> index dd9d5e6..a7b7f66 100644
> --- a/include/block/blockjob.h
> +++ b/include/block/blockjob.h
> @@ -50,6 +50,18 @@ typedef struct BlockJobDriver {
> * manually.
> */
> void (*complete)(BlockJob *job, Error **errp);
> +
> + /**
> + * Optional callback for job types that can be in a transaction. Called
> + * when the transaction succeeds.
> + */
> + void (*txn_commit)(BlockJob *job);
> +
> + /**
> + * Optional callback for job types that can be in a transaction. Call
> when
> + * the transaction fails.
> + */
> + void (*txn_abort)(BlockJob *job);
> } BlockJobDriver;
The semantics of transactions aren't fully documented. My understanding
is that you want:
1. either .txn_commit() or .txn_abort() to be called
2. after all jobs complete (due to success, error, or cancellation).
These two points are important for understanding these interfaces.
pgpv0lotp9Ow1.pgp
Description: PGP signature
- [Qemu-devel] [PATCH v3 02/15] iotests: add transactional incremental backup test, (continued)
- [Qemu-devel] [PATCH v3 02/15] iotests: add transactional incremental backup test, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 03/15] block: rename BlkTransactionState and BdrvActionOps, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 04/15] block: keep bitmap if incremental backup job is cancelled, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 05/15] backup: Extract dirty bitmap handling as a separate function, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 06/15] blockjob: Add .txn_commit and .txn_abort transaction actions, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 07/15] blockjob: Add "completed" and "ret" in BlockJob, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 08/15] blockjob: Simplify block_job_finish_sync, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 09/15] blockjob: Move BlockJobDeferToMainLoopData into BlockJob, Fam Zheng, 2015/07/09
- [Qemu-devel] [PATCH v3 10/15] block: add block job transactions, Fam Zheng, 2015/07/09