From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
"open list:Block layer core" <qemu-block@nongnu.org>
Subject: [Qemu-devel] [PULL 2/7] qemu-iotests: step clock after each test iteration
Date: Tue, 15 Aug 2017 10:09:02 -0500 [thread overview]
Message-ID: <20170815150907.21495-3-eblake@redhat.com> (raw)
In-Reply-To: <20170815150907.21495-1-eblake@redhat.com>
From: Stefan Hajnoczi <stefanha@redhat.com>
The 093 throttling test submits twice as many requests as the throttle
limit in order to ensure that we reach the limit. The remaining
requests are left in-flight at the end of each test iteration.
Commit 452589b6b47e8dc6353df257fc803dfc1383bed8 ("vl.c/exit: pause cpus
before closing block devices") exposed a hang in 093. This happens
because requests are still in flight when QEMU terminates but
QEMU_CLOCK_VIRTUAL time is frozen. bdrv_drain_all() hangs forever since
throttled requests cannot complete.
Step the clock at the end of each test iteration so in-flight requests
actually finish. This solves the hang and is cleaner than leaving tests
in-flight.
Note that this could also be "fixed" by disabling throttling when drives
are closed in QEMU. That approach has two issues:
1. We must drain requests before disabling throttling, so the hang
cannot be easily avoided!
2. Any time QEMU disables throttling internally there is a chance that
malicious users can abuse the code path to bypass throttling limits.
Therefore it makes more sense to fix the test case than to modify QEMU.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20170815130502.8736-1-stefanha@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
tests/qemu-iotests/093 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qemu-iotests/093 b/tests/qemu-iotests/093
index 2ed393a548..ef3997206b 100755
--- a/tests/qemu-iotests/093
+++ b/tests/qemu-iotests/093
@@ -133,6 +133,10 @@ class ThrottleTestCase(iotests.QMPTestCase):
self.assertTrue(check_limit(params['iops_rd'], rd_iops))
self.assertTrue(check_limit(params['iops_wr'], wr_iops))
+ # Allow remaining requests to finish. We submitted twice as many to
+ # ensure the throttle limit is reached.
+ self.vm.qtest("clock_step %d" % ns)
+
# Connect N drives to a VM and test I/O in all of them
def test_all(self):
params = {"bps": 4096,
--
2.13.5
next prev parent reply other threads:[~2017-08-15 15:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 15:09 [Qemu-devel] [PULL for 2.10-rc3 0/7] NBD changes for 2.10-rc3 Eric Blake
2017-08-15 15:09 ` [Qemu-devel] [PULL 1/7] nbd: Fix trace message for disconnect Eric Blake
2017-08-15 15:09 ` Eric Blake [this message]
2017-08-15 15:09 ` [Qemu-devel] [PULL 3/7] stubs: Add vm state change handler stubs Eric Blake
2017-08-15 15:09 ` [Qemu-devel] [PULL 4/7] nbd: Fix order of bdrv_set_perm and bdrv_invalidate_cache Eric Blake
2017-08-15 15:09 ` [Qemu-devel] [PULL 5/7] block-backend: Defer shared_perm tightening migration completion Eric Blake
2017-08-15 15:09 ` [Qemu-devel] [PULL 6/7] iotests: Add non-shared storage migration case 192 Eric Blake
2017-08-15 15:09 ` [Qemu-devel] [PULL 7/7] nbd-client: Fix regression when server sends garbage Eric Blake
2017-08-15 15:50 ` Vladimir Sementsov-Ogievskiy
2017-08-15 16:51 ` Eric Blake
2017-08-16 12:00 ` Vladimir Sementsov-Ogievskiy
2017-08-21 10:11 ` Vladimir Sementsov-Ogievskiy
2017-08-21 10:13 ` Vladimir Sementsov-Ogievskiy
2017-08-23 15:09 ` [Qemu-devel] " Vladimir Sementsov-Ogievskiy
2017-08-23 15:17 ` Eric Blake
2017-08-23 15:21 ` Vladimir Sementsov-Ogievskiy
2017-08-15 17:52 ` [Qemu-devel] [PULL for 2.10-rc3 0/7] NBD changes for 2.10-rc3 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=20170815150907.21495-3-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).