Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions

2015-07-08 Thread Stefan Hajnoczi
On Wed, Jul 08, 2015 at 09:59:24AM +0800, Fam Zheng wrote: > On Tue, 07/07 13:59, Stefan Hajnoczi wrote: > > On Tue, Jul 07, 2015 at 03:32:45PM +0800, Fam Zheng wrote: > > > On Mon, 07/06 15:24, Stefan Hajnoczi wrote: > > > > +/** > > > > + * block_job_txn_add_job: > > > > + * @txn: The transaction

Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions

2015-07-07 Thread Fam Zheng
On Tue, 07/07 13:59, Stefan Hajnoczi wrote: > On Tue, Jul 07, 2015 at 03:32:45PM +0800, Fam Zheng wrote: > > 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 > > > + *

Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions

2015-07-07 Thread Stefan Hajnoczi
On Tue, Jul 07, 2015 at 03:32:45PM +0800, Fam Zheng wrote: > 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 al

Re: [Qemu-devel] [PATCH v2 05/10] block: add block job transactions

2015-07-07 Thread Fam Zheng
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_

[Qemu-devel] [PATCH v2 05/10] block: add block job transactions

2015-07-06 Thread Stefan Hajnoczi
Sometimes block jobs must execute as a transaction group. Finishing jobs wait until all other jobs are ready to complete successfully. Failure or cancellation of one job cancels the other jobs in the group. Signed-off-by: Stefan Hajnoczi --- v2: * Set txn pointer to NULL in block_job_txn_begin(