]> Git Repo - qemu.git/commitdiff
rbd: use BlockDriverState's AioContext
authorStefan Hajnoczi <[email protected]>
Thu, 8 May 2014 14:34:51 +0000 (16:34 +0200)
committerStefan Hajnoczi <[email protected]>
Wed, 4 Jun 2014 07:56:12 +0000 (09:56 +0200)
Drop the assumption that we're using the main AioContext.  Convert
qemu_bh_new() to aio_bh_new() and qemu_aio_wait() to aio_poll().

The .bdrv_detach_aio_context() and .bdrv_attach_aio_context() interfaces
are not needed since no fd handlers, timers, or BHs stay registered when
requests have been drained.

Cc: Josh Durgin <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Josh Durgin <[email protected]>
block/rbd.c

index 09af48426e9d6d4458f879a736481d0ab363a5d0..a78760b7fef6c141a10ddd8ce814be4587b887e1 100644 (file)
@@ -555,7 +555,7 @@ static void qemu_rbd_aio_cancel(BlockDriverAIOCB *blockacb)
     acb->cancelled = 1;
 
     while (acb->status == -EINPROGRESS) {
-        qemu_aio_wait();
+        aio_poll(bdrv_get_aio_context(acb->common.bs), true);
     }
 
     qemu_aio_release(acb);
@@ -588,7 +588,8 @@ static void rbd_finish_aiocb(rbd_completion_t c, RADOSCB *rcb)
     rcb->ret = rbd_aio_get_return_value(c);
     rbd_aio_release(c);
 
-    acb->bh = qemu_bh_new(rbd_finish_bh, rcb);
+    acb->bh = aio_bh_new(bdrv_get_aio_context(acb->common.bs),
+                         rbd_finish_bh, rcb);
     qemu_bh_schedule(acb->bh);
 }
 
This page took 0.022353 seconds and 4 git commands to generate.