From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKhVh-0003LB-KL for qemu-devel@nongnu.org; Thu, 30 Jul 2015 02:40:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKhVg-00011E-Sh for qemu-devel@nongnu.org; Thu, 30 Jul 2015 02:40:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKhVg-000116-NZ for qemu-devel@nongnu.org; Thu, 30 Jul 2015 02:40:08 -0400 From: Fam Zheng Date: Thu, 30 Jul 2015 14:39:22 +0800 Message-Id: <1438238370-16212-7-git-send-email-famz@redhat.com> In-Reply-To: <1438238370-16212-1-git-send-email-famz@redhat.com> References: <1438238370-16212-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v4 06/14] 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: Kevin Wolf , famz@redhat.com, John Snow , Jeff Cody , Max Reitz , vsementsov@parallels.com, stefanha@redhat.com Signed-off-by: Fam Zheng --- 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