[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate() |
Date: |
Wed, 17 May 2017 18:09:40 +0100 |
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>
---
block/io.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/io.c b/block/io.c
index cc56e90..f0041cd 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2031,9 +2031,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;
}
}
--
2.9.3
- [Qemu-devel] [PATCH 0/3] block: fix 'savevm' hang with -object iothread, Stefan Hajnoczi, 2017/05/17
- [Qemu-devel] [PATCH 1/3] block: count bdrv_co_rw_vmstate() requests, Stefan Hajnoczi, 2017/05/17
- [Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(),
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(), Eric Blake, 2017/05/17
- Re: [Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(), Paolo Bonzini, 2017/05/17
- Re: [Qemu-devel] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(), Kevin Wolf, 2017/05/18
- Re: [Qemu-devel] [Qemu-block] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(), Stefan Hajnoczi, 2017/05/18
- Re: [Qemu-devel] [Qemu-block] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(), Kevin Wolf, 2017/05/18
- Re: [Qemu-devel] [Qemu-block] [PATCH 2/3] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate(), Stefan Hajnoczi, 2017/05/18
- [Qemu-devel] [PATCH 3/3] migration: avoid recursive AioContext locking in save_vmstate(), Stefan Hajnoczi, 2017/05/17