[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdr
From: |
Fam Zheng |
Subject: |
[Qemu-block] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdrv_set_aio_context |
Date: |
Wed, 29 Nov 2017 22:49:53 +0800 |
Signed-off-by: Fam Zheng <address@hidden>
---
block.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 9a1a0d1e73..949f0dec11 100644
--- a/block.c
+++ b/block.c
@@ -4745,8 +4745,7 @@ void bdrv_set_aio_context(BlockDriverState *bs,
AioContext *new_context)
{
AioContext *ctx = bdrv_get_aio_context(bs);
- aio_disable_external(ctx);
- bdrv_parent_drained_begin(bs);
+ aio_context_drained_begin(ctx);
bdrv_drain(bs); /* ensure there are no in-flight requests */
while (aio_poll(ctx, false)) {
@@ -4760,8 +4759,7 @@ void bdrv_set_aio_context(BlockDriverState *bs,
AioContext *new_context)
*/
aio_context_acquire(new_context);
bdrv_attach_aio_context(bs, new_context);
- bdrv_parent_drained_end(bs);
- aio_enable_external(ctx);
+ aio_context_drained_end(ctx);
aio_context_release(new_context);
}
--
2.14.3
- [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 1/9] block: Remove unused bdrv_requests_pending, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 2/9] aio: Add drain begin/end API to AioContext, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 3/9] blockjob: Implement AioContext drain ops, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 4/9] throttle: Implement AioContext drain ops, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 5/9] qed: Implement AioContext drain ops, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdrv_set_aio_context,
Fam Zheng <=
- [Qemu-block] [PATCH RFC 7/9] block: Switch to use AIO drained begin/end API, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 8/9] block: Drop old drained_{begin, end} callbacks, Fam Zheng, 2017/11/29
- [Qemu-block] [PATCH RFC 9/9] blockjob: Drop unused functions, Fam Zheng, 2017/11/29
- Re: [Qemu-block] [PATCH RFC 0/9] block: Rewrite block drain begin/end, Kevin Wolf, 2017/11/29