block: Nested drain_end must still call callbacks
bdrv_do_drained_begin() restricts the call of parent callbacks and aio_disable_external() to the outermost drain section, but the block driver callbacks are always called. bdrv_do_drained_end() must match this behaviour, otherwise nodes stay drained even if begin/end calls were balanced. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
8119334918
commit
0f11516894
@ -273,19 +273,21 @@ void bdrv_drained_begin(BlockDriverState *bs)
|
|||||||
|
|
||||||
void bdrv_drained_end(BlockDriverState *bs)
|
void bdrv_drained_end(BlockDriverState *bs)
|
||||||
{
|
{
|
||||||
|
int old_quiesce_counter;
|
||||||
|
|
||||||
if (qemu_in_coroutine()) {
|
if (qemu_in_coroutine()) {
|
||||||
bdrv_co_yield_to_drain(bs, false);
|
bdrv_co_yield_to_drain(bs, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert(bs->quiesce_counter > 0);
|
assert(bs->quiesce_counter > 0);
|
||||||
if (atomic_fetch_dec(&bs->quiesce_counter) > 1) {
|
old_quiesce_counter = atomic_fetch_dec(&bs->quiesce_counter);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Re-enable things in child-to-parent order */
|
/* Re-enable things in child-to-parent order */
|
||||||
bdrv_drain_invoke(bs, false, false);
|
bdrv_drain_invoke(bs, false, false);
|
||||||
|
if (old_quiesce_counter == 1) {
|
||||||
bdrv_parent_drained_end(bs);
|
bdrv_parent_drained_end(bs);
|
||||||
aio_enable_external(bdrv_get_aio_context(bs));
|
aio_enable_external(bdrv_get_aio_context(bs));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user