Re: [Qemu-devel] [PATCH v3 8/9] block: Introduce BlockDriver.bdrv_drain callback

2015-11-09 Thread Paolo Bonzini
On 09/11/2015 03:56, Fam Zheng wrote: > +if (bs->drv && bs->drv->bdrv_drain) { > +bs->drv->bdrv_drain(bs); > +} > +QLIST_FOREACH(child, >children, next) { > +BlockDriverState *cbs = child->bs; > +if (cbs->drv && cbs->drv->bdrv_drain) { > +

Re: [Qemu-devel] [PATCH v3 8/9] block: Introduce BlockDriver.bdrv_drain callback

2015-11-09 Thread Fam Zheng
On Mon, 11/09 10:24, Paolo Bonzini wrote: > > > On 09/11/2015 03:56, Fam Zheng wrote: > > +if (bs->drv && bs->drv->bdrv_drain) { > > +bs->drv->bdrv_drain(bs); > > +} > > +QLIST_FOREACH(child, >children, next) { > > +BlockDriverState *cbs = child->bs; > > +if

[Qemu-devel] [PATCH v3 8/9] block: Introduce BlockDriver.bdrv_drain callback

2015-11-08 Thread Fam Zheng
Drivers can have internal request sources that generate IO, like the need_check_timer in QED. Since we want quiesced periods that contain nested event loops in block layer, we need to have a way to disable such event sources. Block drivers must implement the "bdrv_drain" callback if it has any