[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/10] block: guard bdrv_drain in bdrv_close with ai
From: |
Denis V. Lunev |
Subject: |
[Qemu-devel] [PATCH 05/10] block: guard bdrv_drain in bdrv_close with aio_context_acquire |
Date: |
Tue, 3 Nov 2015 17:12:08 +0300 |
bdrv_close is called in tooooo much places to properly track at the moment.
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
---
block.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block.c b/block.c
index e9f40dc..98b0b66 100644
--- a/block.c
+++ b/block.c
@@ -1895,6 +1895,7 @@ void bdrv_reopen_abort(BDRVReopenState *reopen_state)
void bdrv_close(BlockDriverState *bs)
{
BdrvAioNotifier *ban, *ban_next;
+ AioContext *ctx;
if (bs->job) {
block_job_cancel_sync(bs->job);
@@ -1905,9 +1906,13 @@ void bdrv_close(BlockDriverState *bs)
bdrv_io_limits_disable(bs);
}
+ ctx = bdrv_get_aio_context(bs);
+ aio_context_acquire(ctx);
bdrv_drain(bs); /* complete I/O */
bdrv_flush(bs);
bdrv_drain(bs); /* in case flush left pending I/O */
+ aio_context_release(ctx);
+
notifier_list_notify(&bs->close_notifiers, bs);
if (bs->blk) {
--
2.5.0
[Qemu-devel] [PATCH 07/10] block: call aio_context_acquire in qemu_img/nbd/io, Denis V. Lunev, 2015/11/03
[Qemu-devel] [PATCH 01/10] migration: add missed aio_context_acquire for state writing/reading, Denis V. Lunev, 2015/11/03
[Qemu-devel] [PATCH 02/10] block: add missed aio_context_acquire around bdrv_set_aio_context, Denis V. Lunev, 2015/11/03
[Qemu-devel] [PATCH 04/10] blockdev: acquire AioContext in hmp_commit(), Denis V. Lunev, 2015/11/03
[Qemu-devel] [PATCH 05/10] block: guard bdrv_drain in bdrv_close with aio_context_acquire,
Denis V. Lunev <=
[Qemu-devel] [PATCH 08/10] fifolock: create rfifolock_is_owner helper, Denis V. Lunev, 2015/11/03
[Qemu-devel] [PATCH 10/10] aio: change aio_poll constraints, Denis V. Lunev, 2015/11/03
[Qemu-devel] [PATCH 09/10] aio_context: create aio_context_is_owner helper, Denis V. Lunev, 2015/11/03
[Qemu-devel] [PATCH 06/10] io: guard aio_poll with aio_context_acquire, Denis V. Lunev, 2015/11/03