From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:58921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkGKQ-00060H-P2 for qemu-devel@nongnu.org; Thu, 17 Jan 2019 17:40:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkGKP-0000Ud-Fc for qemu-devel@nongnu.org; Thu, 17 Jan 2019 17:40:02 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:33339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkGKP-0000U3-Bn for qemu-devel@nongnu.org; Thu, 17 Jan 2019 17:40:01 -0500 Received: by mail-qk1-f194.google.com with SMTP id d15so7059319qkj.0 for ; Thu, 17 Jan 2019 14:40:01 -0800 (PST) MIME-Version: 1.0 References: <20190117114359.5164-1-marcandre.lureau@redhat.com> <20190117114359.5164-10-marcandre.lureau@redhat.com> In-Reply-To: From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Fri, 18 Jan 2019 02:39:49 +0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 09/27] slirp: replace qemu_set_nonblock() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel , Li Zhijian , Jan Kiszka , Jason Wang , Zhang Chen , Samuel Thibault , "Bonzini, Paolo" Hi On Thu, Jan 17, 2019 at 9:55 PM Eric Blake wrote: > > On 1/17/19 5:43 AM, Marc-Andr=C3=A9 Lureau wrote: > > Replace qemu_set_nonblock() with slirp_set_nonblock() > > > > qemu_set_nonblock() does some event registration with the main > > loop. Add a new callback register_poll_fd() for that reason. > > > > Always build the fd-register stub, to avoid #if WIN32. > > > > Signed-off-by: Marc-Andr=C3=A9 Lureau > > --- > > > +++ b/slirp/util.c > > @@ -43,6 +43,18 @@ int inet_aton(const char *cp, struct in_addr *ia) > > } > > #endif > > > > +void slirp_set_nonblock(int fd) > > +{ > > +#ifndef _WIN32 > > + int f; > > + f =3D fcntl(fd, F_GETFL); > > + fcntl(fd, F_SETFL, f | O_NONBLOCK); > > No error checking? Is that wise? I did a simple c&p from util/oslib-win32.c & util/oslib-posix.c. Should I add some g_critical() ? > > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. +1-919-301-3226 > Virtualization: qemu.org | libvirt.org >