From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw9hj-0001kz-6Z for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:15:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zw9hd-0005hW-7b for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:15:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw9hd-0005hG-3I for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:15:17 -0500 From: Stefan Hajnoczi Date: Tue, 10 Nov 2015 14:14:10 +0000 Message-Id: <1447164879-6756-16-git-send-email-stefanha@redhat.com> In-Reply-To: <1447164879-6756-1-git-send-email-stefanha@redhat.com> References: <1447164879-6756-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 15/44] blockjob: Add .commit and .abort block job actions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: John Snow , Peter Maydell , Fam Zheng , Stefan Hajnoczi From: Fam Zheng 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 --- include/block/blockjob.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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; /** -- 2.5.0