[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 05/20] tests/test-bdrv-drain: bdrv_drain_all() wo
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH v2 05/20] tests/test-bdrv-drain: bdrv_drain_all() works in coroutines now |
Date: |
Tue, 29 May 2018 19:21:41 +0200 |
Since we use bdrv_do_drained_begin/end() for bdrv_drain_all_begin/end(),
coroutine context is automatically left with a BH, preventing the
deadlocks that made bdrv_drain_all*() unsafe in coroutine context. Now
that we even removed the old polling code as dead code, it's obvious
that it's compatible now.
Enable the coroutine test cases for bdrv_drain_all().
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
tests/test-bdrv-drain.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c
index 4c3e93de0b..17127e63e4 100644
--- a/tests/test-bdrv-drain.c
+++ b/tests/test-bdrv-drain.c
@@ -233,6 +233,11 @@ static void test_drv_cb_drain_subtree(void)
test_drv_cb_common(BDRV_SUBTREE_DRAIN, true);
}
+static void test_drv_cb_co_drain_all(void)
+{
+ call_in_coroutine(test_drv_cb_drain_all);
+}
+
static void test_drv_cb_co_drain(void)
{
call_in_coroutine(test_drv_cb_drain);
@@ -289,6 +294,11 @@ static void test_quiesce_drain_subtree(void)
test_quiesce_common(BDRV_SUBTREE_DRAIN, true);
}
+static void test_quiesce_co_drain_all(void)
+{
+ call_in_coroutine(test_quiesce_drain_all);
+}
+
static void test_quiesce_co_drain(void)
{
call_in_coroutine(test_quiesce_drain);
@@ -800,7 +810,8 @@ int main(int argc, char **argv)
g_test_add_func("/bdrv-drain/driver-cb/drain_subtree",
test_drv_cb_drain_subtree);
- // XXX bdrv_drain_all() doesn't work in coroutine context
+ g_test_add_func("/bdrv-drain/driver-cb/co/drain_all",
+ test_drv_cb_co_drain_all);
g_test_add_func("/bdrv-drain/driver-cb/co/drain", test_drv_cb_co_drain);
g_test_add_func("/bdrv-drain/driver-cb/co/drain_subtree",
test_drv_cb_co_drain_subtree);
@@ -811,7 +822,8 @@ int main(int argc, char **argv)
g_test_add_func("/bdrv-drain/quiesce/drain_subtree",
test_quiesce_drain_subtree);
- // XXX bdrv_drain_all() doesn't work in coroutine context
+ g_test_add_func("/bdrv-drain/quiesce/co/drain_all",
+ test_quiesce_co_drain_all);
g_test_add_func("/bdrv-drain/quiesce/co/drain", test_quiesce_co_drain);
g_test_add_func("/bdrv-drain/quiesce/co/drain_subtree",
test_quiesce_co_drain_subtree);
--
2.13.6
- [Qemu-block] [PATCH v2 00/20] Drain fixes and cleanups, part 3, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 01/20] test-bdrv-drain: bdrv_drain() works with cross-AioContext events, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 02/20] block: Use bdrv_do_drain_begin/end in bdrv_drain_all(), Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 03/20] block: Remove 'recursive' parameter from bdrv_drain_invoke(), Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 04/20] block: Don't manually poll in bdrv_drain_all(), Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 05/20] tests/test-bdrv-drain: bdrv_drain_all() works in coroutines now,
Kevin Wolf <=
- [Qemu-block] [PATCH v2 06/20] block: Avoid unnecessary aio_poll() in AIO_WAIT_WHILE(), Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 07/20] block: Really pause block jobs on drain, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 08/20] block: Remove bdrv_drain_recurse(), Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 09/20] test-bdrv-drain: Add test for node deletion, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 11/20] test-bdrv-drain: Test node deletion in subtree recursion, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 12/20] block: Don't poll in parent drain callbacks, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 10/20] block: Drain recursively with a single BDRV_POLL_WHILE(), Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 13/20] test-bdrv-drain: Graph change through parent callback, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 14/20] block: Defer .bdrv_drain_begin callback to polling phase, Kevin Wolf, 2018/05/29
- [Qemu-block] [PATCH v2 16/20] block: Allow AIO_WAIT_WHILE with NULL ctx, Kevin Wolf, 2018/05/29