[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 8/9] block: Introduce BlockDriver.bdrv_drain
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH v2 8/9] block: Introduce BlockDriver.bdrv_drain callback |
Date: |
Thu, 5 Nov 2015 18:11:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 05/11/2015 17:35, Stefan Hajnoczi wrote:
>> > void bdrv_drain(BlockDriverState *bs)
>> > {
>> > + BdrvChild *child;
>> > bool busy = true;
>> >
>> > + if (bs->drv && bs->drv->bdrv_drain) {
>> > + bs->drv->bdrv_drain(bs);
>> > + }
>> > + QLIST_FOREACH(child, &bs->children, next) {
>> > + bdrv_drain(child->bs);
>> > + }
>> > while (busy) {
>> > /* Keep iterating */
>> > bdrv_flush_io_queue(bs);
> Recursing calls aio_poll() once for each BDS node and I think it's not
> necessary and could be a performance problem.
Indeed, only the call to bs->drv->bdrv_drain should be done recursively.
Paolo