[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 :|
- [PATCH 03/10] include: move qemu_*_exec_dir() to cutils, (continued)
- [PATCH 03/10] include: move qemu_*_exec_dir() to cutils, marcandre . lureau, 2022/04/22
- [PATCH 04/10] tests: move libqtest.h back under qtest/, marcandre . lureau, 2022/04/22
- [PATCH 05/10] libqtest: split QMP part in libqmp, marcandre . lureau, 2022/04/22
- [PATCH 06/10] Replace qemu_pipe() with g_unix_open_pipe(), marcandre . lureau, 2022/04/22
- [PATCH 07/10] tests: make libqmp buildable for win32, marcandre . lureau, 2022/04/22
- [PATCH 08/10] Use g_unix_set_fd_nonblocking(), marcandre . lureau, 2022/04/22
- [PATCH 09/10] block: move fcntl_setfl(), marcandre . lureau, 2022/04/22
- [PATCH 10/10] util/win32: simplify qemu_get_local_state_dir(), marcandre . lureau, 2022/04/22