diff options
author | Max Reitz <mreitz@redhat.com> | 2019-07-22 15:33:44 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-08-16 10:25:16 +0200 |
commit | debc29276714756f278d98ae1929d7813f04030c (patch) | |
tree | 0d67f0d2ccfa2946e4a868b7674a0b8c4a6f0e67 /tests/test-bdrv-drain.c | |
parent | 637d54a5f3a1965fa6aea9e41c4f84abf7a36de9 (diff) |
block: Reduce (un)drains when replacing a child
Currently, bdrv_replace_child_noperm() undrains the parent until it is
completely undrained, then re-drains it after attaching the new child
node.
This is a problem with bdrv_drop_intermediate(): We want to keep the
whole subtree drained, including parents, while the operation is
under way. bdrv_replace_child_noperm() breaks this by allowing every
parent to become unquiesced briefly, and then redraining it.
In fact, there is no reason why the parent should become unquiesced and
be allowed to submit requests to the new child node if that new node is
supposed to be kept drained. So if anything, we have to drain the
parent before detaching the old child node. Conversely, we have to
undrain it only after attaching the new child node.
Thus, change the whole drain algorithm here: Calculate the number of
times we have to drain/undrain the parent before replacing the child
node then drain it (if necessary), replace the child node, and then
undrain it.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/test-bdrv-drain.c')
0 files changed, 0 insertions, 0 deletions