diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-12-16 19:33:47 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-12-18 14:34:44 +0100 |
commit | ba889444957aaeb073a3a95f5cb2794aa1b222f5 (patch) | |
tree | 1bcb1293108150554e7631146a8efdd03cce6459 | |
parent | 27a7649a48f9019fa5bd2998d8e342791397bdda (diff) | |
download | qemu-ba889444957aaeb073a3a95f5cb2794aa1b222f5.zip qemu-ba889444957aaeb073a3a95f5cb2794aa1b222f5.tar.gz qemu-ba889444957aaeb073a3a95f5cb2794aa1b222f5.tar.bz2 |
block: fix bdrv_ioctl called from coroutine
When called from a coroutine, bdrv_ioctl must be asynchronous just like
e.g. bdrv_flush. The code was incorrectly making it synchronous, fix
it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block/io.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2614,10 +2614,11 @@ int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) bdrv_co_ioctl_entry(&data); } else { Coroutine *co = qemu_coroutine_create(bdrv_co_ioctl_entry); + qemu_coroutine_enter(co, &data); - } - while (data.ret == -EINPROGRESS) { - aio_poll(bdrv_get_aio_context(bs), true); + while (data.ret == -EINPROGRESS) { + aio_poll(bdrv_get_aio_context(bs), true); + } } return data.ret; } |