qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine
@ 2015-12-16 18:33 Paolo Bonzini
  2015-12-17  0:59 ` Fam Zheng
  2015-12-18 12:16 ` Kevin Wolf
  0 siblings, 2 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-12-16 18:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: famz

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>
---
        Fam, any reason why you did it this way?  I don't see
        any coroutine caller, but it doesn't make much sense. :)

 block/io.c | 7 ++++---
 1 file 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;
 }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-18 12:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-16 18:33 [Qemu-devel] [PATCH] block: fix bdrv_ioctl called from coroutine Paolo Bonzini
2015-12-17  0:59 ` Fam Zheng
2015-12-17  8:44   ` Paolo Bonzini
2015-12-17 12:33     ` Fam Zheng
2015-12-17 12:51       ` Paolo Bonzini
2015-12-18  1:17         ` Fam Zheng
2015-12-18 12:16 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).