From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 4/5] block: disable I/O limits at the beginning of bdrv_close()
Date: Fri, 2 Oct 2015 14:50:57 +0200 [thread overview]
Message-ID: <1443790258-23305-5-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1443790258-23305-1-git-send-email-kwolf@redhat.com>
From: Alberto Garcia <berto@igalia.com>
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>
---
block.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c
index 6268e37..1f90b47 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);
}
--
1.8.3.1
next prev parent reply other threads:[~2015-10-02 12:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 12:50 [Qemu-devel] [PULL 0/5] Block layer patches Kevin Wolf
2015-10-02 12:50 ` [Qemu-devel] [PULL 1/5] raw-win32: Fix write request error handling Kevin Wolf
2015-10-02 12:50 ` [Qemu-devel] [PULL 2/5] tests: Fix test 049 fallout from improved HMP error messages Kevin Wolf
2015-10-02 12:50 ` [Qemu-devel] [PULL 3/5] iotests: Fix test 128 for password-less sudo Kevin Wolf
2015-10-02 12:50 ` Kevin Wolf [this message]
2015-10-02 12:50 ` [Qemu-devel] [PULL 5/5] block/raw-posix: Open file descriptor O_RDWR to work around glibc posix_fallocate emulation issue Kevin Wolf
2015-10-02 15:03 ` [Qemu-devel] [PULL 0/5] Block layer patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443790258-23305-5-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).