]> git.proxmox.com Git - mirror_qemu.git/commitdiff
bottom halves: introduce bh call function
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Thu, 17 Sep 2015 16:24:50 +0000 (19:24 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 6 Nov 2015 09:16:03 +0000 (10:16 +0100)
This patch introduces aio_bh_call function. It is used to execute
bottom halves as callbacks without adding them to the queue.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20150917162450.8676.56980.stgit@PASHA-ISP.def.inno>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
async.c
include/block/aio.h

diff --git a/async.c b/async.c
index bdc64a3da95c8b4f8cb3db961a8ca8849ab81558..9589e4bb7df2410faa829b79271a28ab1a0c0307 100644 (file)
--- a/async.c
+++ b/async.c
@@ -59,6 +59,11 @@ QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque)
     return bh;
 }
 
+void aio_bh_call(QEMUBH *bh)
+{
+    bh->cb(bh->opaque);
+}
+
 /* Multiple occurrences of aio_bh_poll cannot be called concurrently */
 int aio_bh_poll(AioContext *ctx)
 {
@@ -84,7 +89,7 @@ int aio_bh_poll(AioContext *ctx)
                 ret = 1;
             }
             bh->idle = 0;
-            bh->cb(bh->opaque);
+            aio_bh_call(bh);
         }
     }
 
index bcc7d43f6a39af1042d604a1ea7c28858ded4b51..92efc5e1f1c5b803fbcba5bda7638b645f67ecaf 100644 (file)
@@ -208,6 +208,11 @@ void aio_notify(AioContext *ctx);
  */
 void aio_notify_accept(AioContext *ctx);
 
+/**
+ * aio_bh_call: Executes callback function of the specified BH.
+ */
+void aio_bh_call(QEMUBH *bh);
+
 /**
  * aio_bh_poll: Poll bottom halves for an AioContext.
  *