]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
block: directly invoke .bdrv_aio_*() in bdrv_co_io_em()
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Wed, 5 Oct 2011 16:17:02 +0000 (17:17 +0100)
committerKevin Wolf <kwolf@redhat.com>
Thu, 13 Oct 2011 13:02:27 +0000 (15:02 +0200)
We will unify block layer request processing across sync, aio, and
coroutines and this means a .bdrv_co_*() emulation function should not
call back into the public interface.  There's no need here, just call
.bdrv_aio_*() directly.

The gory details: bdrv_co_io_em() cannot call back into the public
bdrv_aio_*() interface since that will be handled using coroutines,
which causes us to call into bdrv_co_io_em() again in an infinite loop
:).

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c

diff --git a/block.c b/block.c
index 25b03dd07a722f7de59c02ed1874ba2f5b7c5c8a..09f8aad403987e58898b3a28c8616c39092ca03e 100644 (file)
--- a/block.c
+++ b/block.c
@@ -3011,11 +3011,11 @@ static int coroutine_fn bdrv_co_io_em(BlockDriverState *bs, int64_t sector_num,
     BlockDriverAIOCB *acb;
 
     if (is_write) {
-        acb = bdrv_aio_writev(bs, sector_num, iov, nb_sectors,
-                              bdrv_co_io_em_complete, &co);
+        acb = bs->drv->bdrv_aio_writev(bs, sector_num, iov, nb_sectors,
+                                       bdrv_co_io_em_complete, &co);
     } else {
-        acb = bdrv_aio_readv(bs, sector_num, iov, nb_sectors,
-                             bdrv_co_io_em_complete, &co);
+        acb = bs->drv->bdrv_aio_readv(bs, sector_num, iov, nb_sectors,
+                                      bdrv_co_io_em_complete, &co);
     }
 
     trace_bdrv_co_io_em(bs, sector_num, nb_sectors, is_write, acb);