[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 3/5] io: add locking constraints check into bdrv_dr
From: |
Denis V. Lunev |
Subject: |
[Qemu-stable] [PATCH 3/5] io: add locking constraints check into bdrv_drain to ensure locking |
Date: |
Tue, 27 Oct 2015 17:09:44 +0300 |
as described in the comment of the function
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
CC: Paolo Bonzini <address@hidden>
---
block/io.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index 5ac6256..2e98d45 100644
--- a/block/io.c
+++ b/block/io.c
@@ -247,12 +247,15 @@ bool bdrv_requests_pending(BlockDriverState *bs)
void bdrv_drain(BlockDriverState *bs)
{
bool busy = true;
+ AioContext *aio_context = bdrv_get_aio_context(bs);
+
+ assert(aio_context_is_locked(aio_context));
while (busy) {
/* Keep iterating */
bdrv_flush_io_queue(bs);
busy = bdrv_requests_pending(bs);
- busy |= aio_poll(bdrv_get_aio_context(bs), busy);
+ busy |= aio_poll(aio_context, busy);
}
}
--
2.1.4
- [Qemu-stable] [PATCH v2 0/5] dataplane snapshot fixes, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 3/5] io: add locking constraints check into bdrv_drain to ensure locking,
Denis V. Lunev <=
- [Qemu-stable] [PATCH 1/5] fifolock: create rfifolock_is_locked helper, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 2/5] aio_context: create aio_context_is_locked helper, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 5/5] virtio: sync the dataplane vring state to the virtqueue before virtio_save, Denis V. Lunev, 2015/10/27
- [Qemu-stable] [PATCH 4/5] migration: add missed aio_context_acquire into hmp_savevm/hmp_delvm, Denis V. Lunev, 2015/10/27
- Re: [Qemu-stable] [PATCH v2 0/5] dataplane snapshot fixes, Paolo Bonzini, 2015/10/27