qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Subject: [Qemu-devel] [PULL 13/18] bottom halves: introduce bh call function
Date: Wed,  4 Nov 2015 17:17:51 +0100	[thread overview]
Message-ID: <1446653876-116008-14-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1446653876-116008-1-git-send-email-pbonzini@redhat.com>

From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>

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>
---
 async.c             | 7 ++++++-
 include/block/aio.h | 5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/async.c b/async.c
index bdc64a3..9589e4b 100644
--- 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);
         }
     }
 
diff --git a/include/block/aio.h b/include/block/aio.h
index bcc7d43..92efc5e 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -209,6 +209,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.
  *
  * These are internal functions used by the QEMU main loop.
-- 
1.8.3.1

  parent reply	other threads:[~2015-11-04 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04 16:17 [Qemu-devel] [PULL 00/18] Record/replay core for QEMU 2.4-rc1 Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 01/18] replay: global variables and function stubs Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 02/18] replay: internal functions for replay log Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 03/18] replay: introduce mutex to protect the " Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 04/18] replay: introduce icount event Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 05/18] cpu-exec: allow temporary disabling icount Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 06/18] cpu: replay instructions sequence Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 07/18] replay: interrupts and exceptions Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 08/18] replay: asynchronous events infrastructure Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 09/18] replay: recording and replaying clock ticks Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 10/18] replay: shutdown event Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 11/18] icount: improve counting for record/replay Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 12/18] replay: checkpoints Paolo Bonzini
2015-11-04 16:17 ` Paolo Bonzini [this message]
2015-11-04 16:17 ` [Qemu-devel] [PULL 14/18] replay: ptimer Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 15/18] replay: initialization and deinitialization Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 16/18] replay: replay blockers for devices Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 17/18] replay: command line options Paolo Bonzini
2015-11-04 16:17 ` [Qemu-devel] [PULL 18/18] replay: recording of the user input Paolo Bonzini
2015-11-04 18:11 ` [Qemu-devel] [PULL 00/18] Record/replay core for QEMU 2.4-rc1 Alex Bennée
2015-11-05 10:52 ` Peter Maydell
2015-11-05 11:18   ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2015-11-05 12:13 [Qemu-devel] [PULL 00/18] Record/replay core for 2.5-rc1 Paolo Bonzini
2015-11-05 12:13 ` [Qemu-devel] [PULL 13/18] bottom halves: introduce bh call function Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446653876-116008-14-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=pavel.dovgaluk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).