[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 23/23] tests/test-bdrv-drain: Fix too late qemu_event
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 23/23] tests/test-bdrv-drain: Fix too late qemu_event_reset() |
Date: |
Mon, 1 Oct 2018 19:19:01 +0200 |
qemu_event_reset() must be called before the AIO request in a different
iothread is submitted. Otherwise the request could be completed before
we do the qemu_event_reset() and the test would hang in
qemu_event_wait().
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Tested-by: Max Reitz <address@hidden>
---
tests/test-bdrv-drain.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c
index c9f29c8b10..ee1740ff06 100644
--- a/tests/test-bdrv-drain.c
+++ b/tests/test-bdrv-drain.c
@@ -694,6 +694,8 @@ static void test_iothread_common(enum drain_type
drain_type, int drain_thread)
s->bh_indirection_ctx = ctx_b;
aio_ret = -EINPROGRESS;
+ qemu_event_reset(&done_event);
+
if (drain_thread == 0) {
acb = blk_aio_preadv(blk, 0, &qiov, 0, test_iothread_aio_cb, &aio_ret);
} else {
@@ -723,7 +725,6 @@ static void test_iothread_common(enum drain_type
drain_type, int drain_thread)
* but the drain in this thread can continue immediately after
* bdrv_dec_in_flight() and aio_ret might be assigned only slightly
* later. */
- qemu_event_reset(&done_event);
do_drain_begin(drain_type, bs);
g_assert_cmpint(bs->in_flight, ==, 0);
@@ -743,7 +744,6 @@ static void test_iothread_common(enum drain_type
drain_type, int drain_thread)
}
break;
case 1:
- qemu_event_reset(&done_event);
aio_bh_schedule_oneshot(ctx_a, test_iothread_drain_entry, &data);
qemu_event_wait(&done_event);
break;
--
2.13.6
- [Qemu-devel] [PULL 17/23] qcow2: Resize the cache upon image resizing, (continued)
- [Qemu-devel] [PULL 17/23] qcow2: Resize the cache upon image resizing, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 19/23] qcow2: Explicit number replaced by a constant, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 14/23] qcow2: Avoid duplication in setting the refcount cache size, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 18/23] qcow2: Set the default cache-clean-interval to 10 minutes, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 11/23] qcow2: Options' documentation fixes, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 20/23] block-backend: Set werror/rerror defaults in blk_new(), Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 13/23] qcow2: Make sizes more humanly readable, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 12/23] include: Add a lookup table of sizes, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 21/23] qcow2: Fix cache-clean-interval documentation, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 16/23] qcow2: Increase the default upper limit on the L2 cache size, Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 23/23] tests/test-bdrv-drain: Fix too late qemu_event_reset(),
Kevin Wolf <=
- [Qemu-devel] [PULL 22/23] test-replication: Lock AioContext around blk_unref(), Kevin Wolf, 2018/10/01
- [Qemu-devel] [PULL 15/23] qcow2: Assign the L2 cache relatively to the image size, Kevin Wolf, 2018/10/01
- Re: [Qemu-devel] [PULL 00/23] Block layer patches, Peter Maydell, 2018/10/02