Am 18.11.2022 um 18:40 hat Kevin Wolf geschrieben: > I'm aware that exactly nobody has been looking forward to a series with > this title, but it has to be. The way drain works means that we need to > poll in bdrv_replace_child_noperm() and that makes things rather messy > with Emanuele's multiqueue work because you must not poll while you hold > the graph lock. > > The other reason why it has to be is that drain is way too complex and > there are too many different cases. Some simplification like this will > hopefully make it considerably more maintainable. The diffstat probably > tells something, too. > > There are roughly speaking three parts in this series: > > 1. Make BlockDriver.bdrv_drained_begin/end() non-coroutine_fn again, > which allows us to not poll on bdrv_drained_end() any more. > > 2. Remove subtree drains. They are a considerable complication in the > whole drain machinery (in particular, they require polling in the > BdrvChildClass.attach/detach() callbacks that are called during > bdrv_replace_child_noperm()) and none of their users actually has a > good reason to use them. > > 3. Finally get rid of polling in bdrv_replace_child_noperm() by > requiring that the child is already drained by the caller and calling > callbacks only once and not again for every nested drain section. > > If necessary, a prefix of this series can be merged that covers only the > first or the first two parts and it would still make sense.
Thanks for the review, applied to block-next. Kevin