|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH v2 05/12] block: Introduce "drained begin/end" API |
Date: | Mon, 12 Oct 2015 16:27:06 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
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. before the "if". This should also solve Kevin's doubt about new allocating write request reenabling the timer: any write request from the drained section happens normally, until you get a nested drain request and then the callback completes the requests. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |