]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commitdiff
block: fix bdrv_ioctl called from coroutine
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 16 Dec 2015 18:33:47 +0000 (19:33 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 18 Dec 2015 13:34:44 +0000 (14:34 +0100)
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>
block/io.c

index e00fb5d69053354c4658cdf9832479411cefbb6b..841f5b503f18b91e3b72c639e5d5d25c305655f5 100644 (file)
@@ -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;
 }