aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block.c b/block.c
index bb8c067328..4a75bb72ea 100644
--- a/block.c
+++ b/block.c
@@ -1912,6 +1912,10 @@ void bdrv_close(BlockDriverState *bs)
bdrv_drain(bs); /* in case flush left pending I/O */
notifier_list_notify(&bs->close_notifiers, bs);
+ if (bs->blk) {
+ blk_dev_change_media_cb(bs->blk, false);
+ }
+
if (bs->drv) {
BdrvChild *child, *next;
@@ -1950,10 +1954,6 @@ void bdrv_close(BlockDriverState *bs)
bs->full_open_options = NULL;
}
- if (bs->blk) {
- blk_dev_change_media_cb(bs->blk, false);
- }
-
QLIST_FOREACH_SAFE(ban, &bs->aio_notifiers, list, ban_next) {
g_free(ban);
}