From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDI6Z-0005FC-2K for qemu-devel@nongnu.org; Wed, 06 Mar 2013 12:26:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDI6X-0003I1-SZ for qemu-devel@nongnu.org; Wed, 06 Mar 2013 12:26:14 -0500 Received: from mail-gg0-x229.google.com ([2607:f8b0:4002:c02::229]:47254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDI6X-0003Hx-Om for qemu-devel@nongnu.org; Wed, 06 Mar 2013 12:26:13 -0500 Received: by mail-gg0-f169.google.com with SMTP id j5so1237934ggn.28 for ; Wed, 06 Mar 2013 09:26:13 -0800 (PST) Sender: Paolo Bonzini Message-ID: <51377C31.4070506@redhat.com> Date: Wed, 06 Mar 2013 18:26:09 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1362584735-30911-1-git-send-email-stefanha@redhat.com> <1362584735-30911-5-git-send-email-stefanha@redhat.com> In-Reply-To: <1362584735-30911-5-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/5] main-loop: add qemu_get_aio_context() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org Il 06/03/2013 16:45, Stefan Hajnoczi ha scritto: > It is very useful to get the main loop AioContext, which is a static > variable in main-loop.c. > > I'm not sure whether qemu_get_aio_context() will be necessary in the > future once devices focus on using their own AioContext instead of the > main loop AioContext, but for now it allows us to refactor code to > support multiple AioContext while actually passing the main loop > AioContext. > > Signed-off-by: Stefan Hajnoczi > --- > include/qemu/main-loop.h | 5 +++++ > main-loop.c | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h > index 0995288..6f0200a 100644 > --- a/include/qemu/main-loop.h > +++ b/include/qemu/main-loop.h > @@ -82,6 +82,11 @@ int qemu_init_main_loop(void); > int main_loop_wait(int nonblocking); > > /** > + * qemu_get_aio_context: Return the main loop's AioContext > + */ > +AioContext *qemu_get_aio_context(void); > + > +/** > * qemu_notify_event: Force processing of pending events. > * > * Similar to signaling a condition variable, qemu_notify_event forces > diff --git a/main-loop.c b/main-loop.c > index 8c9b58c..eb80ff3 100644 > --- a/main-loop.c > +++ b/main-loop.c > @@ -109,6 +109,11 @@ static int qemu_signal_init(void) > > static AioContext *qemu_aio_context; > > +AioContext *qemu_get_aio_context(void) > +{ > + return qemu_aio_context; > +} > + > void qemu_notify_event(void) > { > if (!qemu_aio_context) { > Reviewed-by: Paolo Bonzini