]> Git Repo - qemu.git/commitdiff
block: disable I/O limits at the beginning of bdrv_close()
authorAlberto Garcia <[email protected]>
Fri, 25 Sep 2015 13:41:44 +0000 (16:41 +0300)
committerKevin Wolf <[email protected]>
Fri, 2 Oct 2015 11:48:29 +0000 (13:48 +0200)
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 <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block.c

diff --git a/block.c b/block.c
index 6268e37afb52f90de550b28e2b4b8026f7e51ddd..1f90b4773fd37c8a65ead2c2d6d9ead164bed3d6 100644 (file)
--- 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);
     }
This page took 0.032951 seconds and 4 git commands to generate.