From: Fam Zheng Date: Thu, 5 Nov 2015 23:13:12 +0000 (-0500) Subject: blockjob: Add .commit and .abort block job actions X-Git-Tag: TizenStudio_2.0_p2.3.2~120^2~1^2~65^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57901ecb8e02f03464d5f37bb6edf82e5076812d;p=sdk%2Femulator%2Fqemu.git blockjob: Add .commit and .abort block job actions Reviewed-by: Max Reitz Reviewed-by: John Snow Signed-off-by: Fam Zheng Signed-off-by: John Snow Message-id: 1446765200-3054-7-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- 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; /**