aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2015-09-25 16:41:44 +0300
committerKevin Wolf <kwolf@redhat.com>2015-10-02 13:48:29 +0200
commit99b7e7756780cec03fe5175db0f53b2fffa9426b (patch)
tree1ae09546da4f5e56feb4c111c0f8bc0255eb3399
parentbb3c801df7ed454b663312326bc29c8b9c2e4de6 (diff)
downloadqemu-arm-99b7e7756780cec03fe5175db0f53b2fffa9426b.tar.gz
block: disable I/O limits at the beginning of bdrv_close()
Disabling I/O limits from a BDS also drains all pending throttled requests, so it should be done at the beginning of bdrv_close() with the rest of the bdrv_drain() calls before the BlockDriver is closed. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block.c b/block.c
index 6268e37afb..1f90b4773f 100644
--- a/block.c
+++ b/block.c
@@ -1907,6 +1907,12 @@ void bdrv_close(BlockDriverState *bs)
if (bs->job) {
block_job_cancel_sync(bs->job);
}
+
+ /* Disable I/O limits and drain all pending throttled requests */
+ if (bs->io_limits_enabled) {
+ bdrv_io_limits_disable(bs);
+ }
+
bdrv_drain(bs); /* complete I/O */
bdrv_flush(bs);
bdrv_drain(bs); /* in case flush left pending I/O */
@@ -1958,11 +1964,6 @@ void bdrv_close(BlockDriverState *bs)
blk_dev_change_media_cb(bs->blk, false);
}
- /*throttling disk I/O limits*/
- if (bs->io_limits_enabled) {
- bdrv_io_limits_disable(bs);
- }
-
QLIST_FOREACH_SAFE(ban, &bs->aio_notifiers, list, ban_next) {
g_free(ban);
}