From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDPHe-0007Yx-1O for qemu-devel@nongnu.org; Thu, 09 Jul 2015 23:47:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDPHd-00074J-AZ for qemu-devel@nongnu.org; Thu, 09 Jul 2015 23:47:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDPHd-000749-5w for qemu-devel@nongnu.org; Thu, 09 Jul 2015 23:47:29 -0400 From: Fam Zheng Date: Fri, 10 Jul 2015 11:46:43 +0800 Message-Id: <1436500012-32593-7-git-send-email-famz@redhat.com> In-Reply-To: <1436500012-32593-1-git-send-email-famz@redhat.com> References: <1436500012-32593-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v3 06/15] blockjob: Add .txn_commit and .txn_abort transaction 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 They will be called if the job is part of a transaction, after all jobs in a transaction are completed or cancelled, before calling job->cb(). Signed-off-by: Fam Zheng --- include/block/blockjob.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/block/blockjob.h b/include/block/blockjob.h index dd9d5e6..a7b7f66 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -50,6 +50,18 @@ typedef struct BlockJobDriver { * manually. */ void (*complete)(BlockJob *job, Error **errp); + + /** + * Optional callback for job types that can be in a transaction. Called + * when the transaction succeeds. + */ + void (*txn_commit)(BlockJob *job); + + /** + * Optional callback for job types that can be in a transaction. Call when + * the transaction fails. + */ + void (*txn_abort)(BlockJob *job); } BlockJobDriver; /** -- 2.4.3