[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 18/25] rbd: use BlockDriverState's AioContext

From: Josh Durgin
Subject: Re: [Qemu-devel] [PATCH v3 18/25] rbd: use BlockDriverState's AioContext
Date: Thu, 08 May 2014 17:04:16 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 05/08/2014 07:34 AM, Stefan Hajnoczi wrote:
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 <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
  block/rbd.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/rbd.c b/block/rbd.c
index dbc79f4..41f7bdc 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -548,7 +548,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);

@@ -581,7 +581,8 @@ static void rbd_finish_aiocb(rbd_completion_t c, RADOSCB 
      rcb->ret = rbd_aio_get_return_value(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);

Assuming bdrv_get_aio_context() continues to be safe to call from a
non-qemu thread:

Reviewed-by: Josh Durgin <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]