qemu-devel
[Top][All Lists]
Advanced

[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
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]