[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/27] slirp: replace qemu_set_nonblock()
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH 09/27] slirp: replace qemu_set_nonblock() |
Date: |
Fri, 18 Jan 2019 02:39:49 +0400 |
Hi
On Thu, Jan 17, 2019 at 9:55 PM Eric Blake <address@hidden> wrote:
>
> On 1/17/19 5:43 AM, Marc-André 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é Lureau <address@hidden>
> > ---
>
> > +++ 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 = 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
>
- [Qemu-devel] [PATCH 05/27] slirp: add callbacks for timer, (continued)
- [Qemu-devel] [PATCH 05/27] slirp: add callbacks for timer, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 06/27] slirp: replace trace functions with DEBUG calls, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 07/27] slirp: replace QEMU_PACKED with SLIRP_PACKED, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 08/27] slirp: replace most qemu socket utilities with slirp own version, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 09/27] slirp: replace qemu_set_nonblock(), Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 11/27] slirp: replace qemu_notify_event() with a callback, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 10/27] slirp: add unregister_poll_fd() callback, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 13/27] slirp: do not include qemu headers in libslirp.h public API header, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 12/27] slirp: move QEMU state saving to a separate unit, Marc-André Lureau, 2019/01/17
- [Qemu-devel] [PATCH 14/27] slirp: improve windows headers inclusion, Marc-André Lureau, 2019/01/17