qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Stefan Weil <sw@weilnetz.de>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 9/9] slirp: Remove unused pollfds from the parameter list
Date: Tue, 16 Jun 2015 15:15:17 +0100	[thread overview]
Message-ID: <20150616141517.GA4958@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1433926791-10580-10-git-send-email-famz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]

On Wed, Jun 10, 2015 at 04:59:51PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  main-loop.c      | 4 ++--
>  slirp/libslirp.h | 4 ++--
>  slirp/slirp.c    | 4 ++--
>  stubs/slirp.c    | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/main-loop.c b/main-loop.c
> index 18b7508..b3808ae 100644
> --- a/main-loop.c
> +++ b/main-loop.c
> @@ -478,7 +478,7 @@ int main_loop_wait(int nonblocking)
>      g_array_set_size(gpollfds, 0); /* reset for new iteration */
>      /* XXX: separate device handlers from system ones */
>  #ifdef CONFIG_SLIRP
> -    slirp_pollfds_fill(gpollfds, &timeout);
> +    slirp_poll_prepare(&timeout);
>  #endif
>  
>      if (timeout == UINT32_MAX) {
> @@ -493,7 +493,7 @@ int main_loop_wait(int nonblocking)
>  
>      ret = os_host_main_loop_wait(timeout_ns);
>  #ifdef CONFIG_SLIRP
> -    slirp_pollfds_poll(gpollfds, (ret < 0));
> +    slirp_poll();

The final step is to remove slirp calls completely from
main_loop_wait().  slirp should use the qemu_set_fd_handler() and timer
APIs directly instead of requiring callbacks around ppoll().

That would probably even make the slirp code simpler since it currently
splits evented I/O into two phases:
1. Set slirp-internal state
2. Reflect slirp-internal state into iohandler and check timeouts after
   ppoll()

If slirp calls the appropriate qemu_set_fd_handler() and timer APIs
*during* state transitions it won't have to use the two-step approach.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-06-16 14:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10  8:59 [Qemu-devel] [PATCH 0/9] slirp: iohandler: Rebase onto aio Fam Zheng
2015-06-10  8:59 ` [Qemu-devel] [PATCH 1/9] aio: Introduce aio_set_fd_handler_pri Fam Zheng
2015-06-10  8:59 ` [Qemu-devel] [PATCH 2/9] iohandler: Use aio code Fam Zheng
2015-06-16 13:57   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-06-19  1:05     ` Fam Zheng
2015-06-10  8:59 ` [Qemu-devel] [PATCH 3/9] main-loop: Move include of "qemu/sockets.h" to libslirp.h Fam Zheng
2015-06-16 13:58   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-06-10  8:59 ` [Qemu-devel] [PATCH 4/9] slirp: Remove dead code for "PROBE_CONN" Fam Zheng
2015-06-16 14:00   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2015-06-10  8:59 ` [Qemu-devel] [PATCH 5/9] slirp: Add "poll_events" to struct socket Fam Zheng
2015-06-10  8:59 ` [Qemu-devel] [PATCH 6/9] slirp: Move icmp socket to iohandler Fam Zheng
2015-06-10  8:59 ` [Qemu-devel] [PATCH 7/9] slirp: Move udb " Fam Zheng
2015-06-10  8:59 ` [Qemu-devel] [PATCH 8/9] slirp: Move tcb " Fam Zheng
2015-06-10  8:59 ` [Qemu-devel] [PATCH 9/9] slirp: Remove unused pollfds from the parameter list Fam Zheng
2015-06-16 14:15   ` Stefan Hajnoczi [this message]
2015-06-19  1:03     ` Fam Zheng
2015-06-16 14:16 ` [Qemu-devel] [Qemu-block] [PATCH 0/9] slirp: iohandler: Rebase onto aio 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=20150616141517.GA4958@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=famz@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /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).