From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4re7-0008SV-TT for qemu-devel@nongnu.org; Tue, 16 Jun 2015 10:15:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4re4-0007rC-2h for qemu-devel@nongnu.org; Tue, 16 Jun 2015 10:15:23 -0400 Date: Tue, 16 Jun 2015 15:15:17 +0100 From: Stefan Hajnoczi Message-ID: <20150616141517.GA4958@stefanha-thinkpad.redhat.com> References: <1433926791-10580-1-git-send-email-famz@redhat.com> <1433926791-10580-10-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: <1433926791-10580-10-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 9/9] slirp: Remove unused pollfds from the parameter list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-block@nongnu.org, Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi , Jan Kiszka , Paolo Bonzini --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 10, 2015 at 04:59:51PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > main-loop.c | 4 ++-- > slirp/libslirp.h | 4 ++-- > slirp/slirp.c | 4 ++-- > stubs/slirp.c | 4 ++-- > 4 files changed, 8 insertions(+), 8 deletions(-) >=20 > 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 > =20 > if (timeout =3D=3D UINT32_MAX) { > @@ -493,7 +493,7 @@ int main_loop_wait(int nonblocking) > =20 > ret =3D 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 --Q68bSM7Ycu6FN28Q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVgC91AAoJEJykq7OBq3PIsPIH/RqnYqrrHIvaCR2ILA0Fkliu 8+LIUh8ZYwznfauTSHgIRrJZOl4A8ONJXr4u5HWb2WGOwtrPcPqLJEBMkRFQMhd+ uoTh29DBwXro95xe1E3+d471NDESr0ozf3Vvz+gFREuZ780T7DmmP5gVu4ne9xO6 3SctEbtrsQJ8pAmEq3VPXnmotU67OQflK09hC+MYiELKpiyPfEypGV4RQ48WBKVK JtBShCFKOJgesbsqfIBFttgKuCXtUWS4gLY+3gpd8XT7YKmnSQPU9wg0/b2OAm12 yrw0x66nDyG1DogcYPhE79UacV9MreOJHt6mEBUezbxL0qjRKoAZd7Sw3mDT3iY= =+uQ3 -----END PGP SIGNATURE----- --Q68bSM7Ycu6FN28Q--