[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 9/9] slirp: Remove unused pollfds from the param
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 9/9] slirp: Remove unused pollfds from the parameter list |
Date: |
Fri, 19 Jun 2015 09:03:28 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, 06/16 15:15, Stefan Hajnoczi wrote:
> On Wed, Jun 10, 2015 at 04:59:51PM +0800, Fam Zheng wrote:
> > Signed-off-by: Fam Zheng <address@hidden>
> > ---
> > 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.
Yes, that's right, but it is a harder change that I want to leave for a
separate series.
Fam
- [Qemu-devel] [PATCH 3/9] main-loop: Move include of "qemu/sockets.h" to libslirp.h, (continued)
- [Qemu-devel] [PATCH 3/9] main-loop: Move include of "qemu/sockets.h" to libslirp.h, Fam Zheng, 2015/06/10
- [Qemu-devel] [PATCH 4/9] slirp: Remove dead code for "PROBE_CONN", Fam Zheng, 2015/06/10
- [Qemu-devel] [PATCH 6/9] slirp: Move icmp socket to iohandler, Fam Zheng, 2015/06/10
- [Qemu-devel] [PATCH 5/9] slirp: Add "poll_events" to struct socket, Fam Zheng, 2015/06/10
- [Qemu-devel] [PATCH 8/9] slirp: Move tcb socket to iohandler, Fam Zheng, 2015/06/10
- [Qemu-devel] [PATCH 7/9] slirp: Move udb socket to iohandler, Fam Zheng, 2015/06/10
- [Qemu-devel] [PATCH 9/9] slirp: Remove unused pollfds from the parameter list, Fam Zheng, 2015/06/10
- Re: [Qemu-devel] [Qemu-block] [PATCH 0/9] slirp: iohandler: Rebase onto aio, Stefan Hajnoczi, 2015/06/16