block: Allow graph changes in subtree drained section

We need to remember how many of the drain sections in which a node is
were recursive (i.e. subtree drain rather than node drain), so that they
can be correctly applied when children are added or removed during the
drained section.

With this change, it is safe to modify the graph even inside a
bdrv_subtree_drained_begin/end() section.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2017-12-18 16:05:48 +01:00
parent 27e64474a3
commit d736f119da
4 changed files with 58 additions and 9 deletions

View file

@ -610,8 +610,6 @@ void bdrv_drained_begin(BlockDriverState *bs);
/**
* Like bdrv_drained_begin, but recursively begins a quiesced section for
* exclusive access to all child nodes as well.
*
* Graph changes are not allowed during a subtree drain section.
*/
void bdrv_subtree_drained_begin(BlockDriverState *bs);