Re: [Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-25 Thread Fam Zheng
On Fri, 10/23 16:24, Stefan Hajnoczi wrote: > On Fri, Oct 23, 2015 at 11:08:09AM +0800, Fam Zheng wrote: > > +/** > > + * bdrv_drained_begin: > > + * > > + * Begin a quiesced section for exclusive access to the BDS, by disabling > > + * external request sources including NBD server and device

Re: [Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:09AM +0800, Fam Zheng wrote: > +void bdrv_drained_begin(BlockDriverState *bs) > +{ > +if (!bs->quiesce_counter++) { > +aio_disable_external(bdrv_get_aio_context(bs)); > +} > +bdrv_drain(bs); > +} > + > +void bdrv_drained_end(BlockDriverState *bs) >

Re: [Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-23 Thread Stefan Hajnoczi
On Fri, Oct 23, 2015 at 11:08:09AM +0800, Fam Zheng wrote: > +/** > + * bdrv_drained_begin: > + * > + * Begin a quiesced section for exclusive access to the BDS, by disabling > + * external request sources including NBD server and device model. Note that > + * this doesn't block timers or

[Qemu-block] [PATCH v7 05/10] block: Introduce "drained begin/end" API

2015-10-22 Thread Fam Zheng
The semantics is that after bdrv_drained_begin(bs), bs will not get new external requests until the matching bdrv_drained_end(bs). Signed-off-by: Fam Zheng --- block/io.c| 17 + include/block/block.h | 19 +++