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

2015-10-13 Thread Kevin Wolf
Am 13.10.2015 um 12:39 hat Paolo Bonzini geschrieben: > > > On 13/10/2015 11:31, Kevin Wolf wrote: > > This would mean that once you've sent an I/O request inside a drain > > section, you have to expect that more internal I/O might be going on > > after the request has completed. If you don't wan

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

2015-10-13 Thread Paolo Bonzini
On 13/10/2015 11:31, Kevin Wolf wrote: > This would mean that once you've sent an I/O request inside a drain > section, you have to expect that more internal I/O might be going on > after the request has completed. If you don't want this, you have to > issue another bdrv_drain() or use a nested b

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

2015-10-13 Thread Kevin Wolf
Am 12.10.2015 um 16:27 hat Paolo Bonzini geschrieben: > > > On 12/10/2015 13:50, Fam Zheng wrote: > > +void bdrv_drained_begin(BlockDriverState *bs) > > +{ > > +if (bs->quiesce_counter++) { > > +return; > > +} > > +aio_disable_external(bdrv_get_aio_context(bs)); > > +bdrv_

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

2015-10-12 Thread Paolo Bonzini
On 12/10/2015 13:50, Fam Zheng wrote: > +void bdrv_drained_begin(BlockDriverState *bs) > +{ > +if (bs->quiesce_counter++) { > +return; > +} > +aio_disable_external(bdrv_get_aio_context(bs)); > +bdrv_drain(bs); > +} I think bdrv_drain should be called unconditionally, i.e.

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

2015-10-12 Thread Kevin Wolf
Am 12.10.2015 um 13:50 hat Fam Zheng geschrieben: > 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.c | 2 ++ > block/io.c| 18 +++

[Qemu-block] [PATCH v2 05/12] block: Introduce "drained begin/end" API

2015-10-12 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.c | 2 ++ block/io.c| 18 ++ include/block/block.h | 19 +++