From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuJQz-00020J-GV for qemu-devel@nongnu.org; Thu, 05 Nov 2015 07:14:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuJQy-0002R0-EL for qemu-devel@nongnu.org; Thu, 05 Nov 2015 07:14:29 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:35495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuJQy-0002Qu-9I for qemu-devel@nongnu.org; Thu, 05 Nov 2015 07:14:28 -0500 Received: by wmll128 with SMTP id l128so10425725wml.0 for ; Thu, 05 Nov 2015 04:14:27 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 5 Nov 2015 13:13:58 +0100 Message-Id: <1446725643-82458-14-git-send-email-pbonzini@redhat.com> In-Reply-To: <1446725643-82458-1-git-send-email-pbonzini@redhat.com> References: <1446725643-82458-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 13/18] bottom halves: introduce bh call function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Pavel Dovgalyuk From: Pavel Dovgalyuk 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 Message-Id: <20150917162450.8676.56980.stgit@PASHA-ISP.def.inno> Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- 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