aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/block-backend.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index 45d9101be3..18e543780d 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -655,12 +655,16 @@ BlockBackend *blk_by_public(BlockBackendPublic *public)
*/
void blk_remove_bs(BlockBackend *blk)
{
+ BlockDriverState *bs;
ThrottleTimers *tt;
notifier_list_notify(&blk->remove_bs_notifiers, blk);
if (blk->public.throttle_group_member.throttle_state) {
tt = &blk->public.throttle_group_member.throttle_timers;
+ bs = blk_bs(blk);
+ bdrv_drained_begin(bs);
throttle_timers_detach_aio_context(tt);
+ bdrv_drained_end(bs);
}
blk_update_root_state(blk);