From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCNN9-0007lC-I9 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 03:32:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCNN4-0006yT-CT for qemu-devel@nongnu.org; Tue, 07 Jul 2015 03:32:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCNN4-0006yJ-3k for qemu-devel@nongnu.org; Tue, 07 Jul 2015 03:32:50 -0400 Date: Tue, 7 Jul 2015 15:32:45 +0800 From: Fam Zheng Message-ID: <20150707073245.GD9515@ad.nay.redhat.com> References: <1436192669-10062-1-git-send-email-stefanha@redhat.com> <1436192669-10062-6-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436192669-10062-6-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Jeff Cody , qemu-devel@nongnu.org, Max Reitz , vsementsov@parallels.com, John Snow On Mon, 07/06 15:24, Stefan Hajnoczi wrote: > +/** > + * block_job_txn_add_job: > + * @txn: The transaction (may be NULL) > + * @job: Job to add to the transaction > + * > + * Add @job to the transaction. The @job must not already be in a transaction. > + * The block job driver must call block_job_txn_prepare_to_complete() before s/block_job_txn_prepare_to_complete/block_job_txn_job_done/ Reading this for a second time I start to feel it too complicated for the good. I have another idea: in block_job_completed, check if other jobs have failed, and call this job driver's (imaginary) "abort()" callback accordingly; if all jobs has succeeded, call a "commit" callback during last block_job_completed. Does that make sense? Fam