aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2015-11-05 18:13:12 -0500
committerKevin Wolf <kwolf@redhat.com>2015-11-12 16:22:44 +0100
commit57901ecb8e02f03464d5f37bb6edf82e5076812d (patch)
tree12b8c0ea4c8c70ef389a82f635e55e2df7695a22 /include
parent18930ba3d17866fff6df52ae6d2e54ce5c5ca04b (diff)
downloadqemu-57901ecb8e02f03464d5f37bb6edf82e5076812d.zip
qemu-57901ecb8e02f03464d5f37bb6edf82e5076812d.tar.gz
qemu-57901ecb8e02f03464d5f37bb6edf82e5076812d.tar.bz2
blockjob: Add .commit and .abort block job actions
Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1446765200-3054-7-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/blockjob.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index b649a40..ed856d7 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -50,6 +50,26 @@ 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.
+ *
+ * All jobs will complete with a call to either .commit() or .abort() but
+ * never both.
+ */
+ 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.
+ *
+ * All jobs will complete with a call to either .commit() or .abort() but
+ * never both.
+ */
+ void (*abort)(BlockJob *job);
} BlockJobDriver;
/**