Reviewed-by: Max Reitz <mre...@redhat.com>
Signed-off-by: Fam Zheng <f...@redhat.com>
---
 include/block/blockjob.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 3e7ad21..a7b497c 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -50,6 +50,24 @@ typedef struct BlockJobDriver {
      * manually.
      */
     void (*complete)(BlockJob *job, Error **errp);
+
+    /**
+     * If the callback is not NULL, it will be invoked when all the jobs
+     * belonging to the same transaction complete; or upon this job's
+     * completion if it is not in a transaction. Skipped if NULL.
+     *
+     * Exactly one of .commit() and .abort() will be called for each job.
+     */
+    void (*commit)(BlockJob *job);
+
+    /**
+     * If the callback is not NULL, it will be invoked when any job in the
+     * same transaction fails; or upon this job's failure (due to error or
+     * cancellation) if it is not in a transaction. Skipped if NULL.
+     *
+     * Exactly one of .commit() and .abort() will be called for each job.
+     */
+    void (*abort)(BlockJob *job);
 } BlockJobDriver;
 
 /**
-- 
2.4.3


Reply via email to