qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 08/10] Use g_unix_set_fd_nonblocking()


From: Daniel P . Berrangé
Subject: Re: [PATCH 08/10] Use g_unix_set_fd_nonblocking()
Date: Fri, 22 Apr 2022 09:56:06 +0100
User-agent: Mutt/2.1.5 (2021-12-30)

On Fri, Apr 22, 2022 at 12:36:37PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> API available since glib 2.30. It also preserves errno.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  hw/misc/ivshmem.c           | 2 +-
>  util/event_notifier-posix.c | 6 ++----
>  util/main-loop.c            | 2 +-
>  3 files changed, 4 insertions(+), 6 deletions(-)

There are many more places in QEMU setting O_NONBLOCK.

$ git grep '\bO_NONBLOCK' | grep -i setfl
hw/misc/ivshmem.c:    fcntl_setfl(fd, O_NONBLOCK); /* msix/irqfd poll non block 
*/
hw/rdma/rdma_backend.c:    rc = fcntl(backend_dev->channel->fd, F_SETFL, flags 
| O_NONBLOCK);
linux-user/syscall.c:        if (fcntl(fd, F_SETFL, O_NONBLOCK | flags) == -1) {
net/tap-bsd.c:    fcntl(fd, F_SETFL, O_NONBLOCK);
net/tap-bsd.c:    fcntl(fd, F_SETFL, O_NONBLOCK);
net/tap-linux.c:    fcntl(fd, F_SETFL, O_NONBLOCK);
net/tap-solaris.c:    fcntl(fd, F_SETFL, O_NONBLOCK);
tests/qtest/fuzz/virtio_net_fuzz.c:    fcntl(sockfds[0], F_SETFL, O_NONBLOCK);
tests/tcg/multiarch/linux-test.c:    chk_error(fcntl(fds[0], F_SETFL, 
O_NONBLOCK));
tests/tcg/multiarch/linux-test.c:    chk_error(fcntl(fds[1], F_SETFL, 
O_NONBLOCK));
tests/unit/test-iov.c:       fcntl(sv[1], F_SETFL, O_RDWR|O_NONBLOCK);
tests/unit/test-iov.c:       fcntl(sv[0], F_SETFL, O_RDWR|O_NONBLOCK);
util/event_notifier-posix.c:        ret = fcntl_setfl(fds[0], O_NONBLOCK);
util/event_notifier-posix.c:        ret = fcntl_setfl(fds[1], O_NONBLOCK);
util/main-loop.c:    fcntl_setfl(sigfd, O_NONBLOCK);
util/oslib-posix.c:    f = fcntl(fd, F_SETFL, f & ~O_NONBLOCK);
util/oslib-posix.c:    if (fcntl(fd, F_SETFL, f | O_NONBLOCK) == -1) {


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

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