summaryrefslogtreecommitdiffstats
path: root/block/io.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-12-16 19:33:47 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:20 -0600
commitcd6c971d3583c7174fb731af52973f64f88176c6 (patch)
treee791a62bcc7223cf61777e5d80a1ac9c1a772002 /block/io.c
parenteab52fbb038fdfd7252f60f48c998c844166d50d (diff)
downloadhqemu-cd6c971d3583c7174fb731af52973f64f88176c6.zip
hqemu-cd6c971d3583c7174fb731af52973f64f88176c6.tar.gz
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>
Diffstat (limited to 'block/io.c')
-rw-r--r--block/io.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/io.c b/block/io.c
index e00fb5d..841f5b5 100644
--- a/block/io.c
+++ b/block/io.c
@@ -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;
}
OpenPOWER on IntegriCloud