All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/5] main-loop: add qemu_get_aio_context()
Date: Wed, 06 Mar 2013 18:26:09 +0100	[thread overview]
Message-ID: <51377C31.4070506@redhat.com> (raw)
In-Reply-To: <1362584735-30911-5-git-send-email-stefanha@redhat.com>

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 <stefanha@redhat.com>
> ---
>  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 <pbonzini@redhat.com>

  reply	other threads:[~2013-03-06 17:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 15:45 [Qemu-devel] [PATCH 0/5] threadpool: support multiple ThreadPools Stefan Hajnoczi
2013-03-06 15:45 ` [Qemu-devel] [PATCH 1/5] threadpool: move globals into struct ThreadPool Stefan Hajnoczi
2013-03-06 17:25   ` Paolo Bonzini
2013-03-08  3:18   ` Wenchao Xia
2013-03-06 15:45 ` [Qemu-devel] [PATCH 2/5] threadpool: add thread_pool_new() and thread_pool_free() Stefan Hajnoczi
2013-03-06 16:36   ` Paolo Bonzini
2013-03-06 15:45 ` [Qemu-devel] [PATCH 3/5] aio: add a ThreadPool instance to AioContext Stefan Hajnoczi
2013-03-06 17:24   ` Paolo Bonzini
2013-03-07 10:02     ` Stefan Hajnoczi
2013-03-06 15:45 ` [Qemu-devel] [PATCH 4/5] main-loop: add qemu_get_aio_context() Stefan Hajnoczi
2013-03-06 17:26   ` Paolo Bonzini [this message]
2013-03-06 15:45 ` [Qemu-devel] [PATCH 5/5] threadpool: drop global thread pool Stefan Hajnoczi
2013-03-06 16:35   ` Paolo Bonzini
2013-03-07 10:07     ` Stefan Hajnoczi

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=51377C31.4070506@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.