From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEmoF-0001GS-2Q for qemu-devel@nongnu.org; Mon, 13 Jul 2015 19:06:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEmo8-00065u-TM for qemu-devel@nongnu.org; Mon, 13 Jul 2015 19:06:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEmo8-00065q-Nl for qemu-devel@nongnu.org; Mon, 13 Jul 2015 19:06:44 -0400 Message-ID: <55A44483.8050903@redhat.com> Date: Mon, 13 Jul 2015 19:06:43 -0400 From: John Snow MIME-Version: 1.0 References: <1436500012-32593-1-git-send-email-famz@redhat.com> <1436500012-32593-7-git-send-email-famz@redhat.com> In-Reply-To: <1436500012-32593-7-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [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: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , vsementsov@parallels.com, stefanha@redhat.com, Max Reitz On 07/09/2015 11:46 PM, Fam Zheng wrote: > 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; > > /** > Reviewed-by: John Snow