[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 05/61] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstat
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 05/61] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate() |
Date: |
Fri, 23 Jun 2017 18:21:03 +0200 |
From: Stefan Hajnoczi <address@hidden>
Calling aio_poll() directly may have been fine previously, but this is
the future, man! The difference between an aio_poll() loop and
BDRV_POLL_WHILE() is that BDRV_POLL_WHILE() releases the AioContext
around aio_poll().
This allows the IOThread to run fd handlers or BHs to complete the
request. Failure to release the AioContext causes deadlocks.
Using BDRV_POLL_WHILE() partially fixes a 'savevm' hang with -object
iothread.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/io.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/io.c b/block/io.c
index 684ea46..e158ae0 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2023,9 +2023,7 @@ bdrv_rw_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
int64_t pos,
Coroutine *co = qemu_coroutine_create(bdrv_co_rw_vmstate_entry, &data);
bdrv_coroutine_enter(bs, co);
- while (data.ret == -EINPROGRESS) {
- aio_poll(bdrv_get_aio_context(bs), true);
- }
+ BDRV_POLL_WHILE(bs, data.ret == -EINPROGRESS);
return data.ret;
}
}
--
1.8.3.1
- [Qemu-block] [PULL 00/61] Block layer patches, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 01/61] commit: Fix completion with extra reference, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 02/61] qemu-iotests: Allow starting new qemu after cleanup, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 04/61] block: count bdrv_co_rw_vmstate() requests, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 03/61] qemu-iotests: Test exiting qemu with running job, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 05/61] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(),
Kevin Wolf <=
- [Qemu-block] [PULL 06/61] migration: avoid recursive AioContext locking in save_vmstate(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 07/61] migration: use bdrv_drain_all_begin/end() instead bdrv_drain_all(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 10/61] throttle: Update throttle-groups.c documentation, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 09/61] doc: Document driver-specific -blockdev options, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 08/61] doc: Document generic -blockdev options, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 12/61] migration: hold AioContext lock for loadvm qemu_fclose(), Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 13/61] qemu-iotests: 068: extract _qemu() function, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 14/61] qemu-iotests: 068: use -drive/-device instead of -hda, Kevin Wolf, 2017/06/23
- [Qemu-block] [PULL 11/61] virtio-pci: use ioeventfd even when KVM is disabled, Kevin Wolf, 2017/06/23