On 14.12.21 19:10, Emanuele Giuseppe Esposito wrote:


On 13/12/2021 15:52, Stefan Hajnoczi wrote:
Off-topic: I don't understand the difference between the effects of
bdrv_drained_begin() and bdrv_subtree_drained_begin(). Both call
aio_disable_external(aio_context) and aio_poll(). bdrv_drained_begin()
only polls parents and itself, while bdrv_subtree_drained_begin() also
polls children. But why does that distinction matter? I wouldn't know
when to use one over the other.

Good point. Now I am wondering the same, so it would be great if anyone could clarify it.

As far as I understand, bdrv_drained_begin() is used to drain and stop requests on a single BDS, whereas bdrv_subtree_drained_begin() drains the BDS and all of its children.  So when you don’t care about lingering requests in child nodes, then bdrv_drained_begin() suffices.

Hanna


Reply via email to