[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/10] Use g_unix_set_fd_nonblocking()
From: |
Eric Blake |
Subject: |
Re: [PATCH 08/10] Use g_unix_set_fd_nonblocking() |
Date: |
Fri, 22 Apr 2022 09:24:55 -0500 |
User-agent: |
NeoMutt/20211029-35-db88c3 |
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(-)
>
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index e7c0099bdaf6..a1cd3dcc51cf 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -537,7 +537,7 @@ static void process_msg_connect(IVShmemState *s, uint16_t
> posn, int fd,
>
> IVSHMEM_DPRINTF("eventfds[%d][%d] = %d\n", posn, vector, fd);
> event_notifier_init_fd(&peer->eventfds[vector], fd);
> - fcntl_setfl(fd, O_NONBLOCK); /* msix/irqfd poll non block */
> + g_unix_set_fd_nonblocking(fd, TRUE, NULL); /* msix/irqfd poll non block
> */
Does glib require us to use their non-standard TRUE, or can we merely
pass true and rely on C promotion rules to make the code look nicer?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH 04/10] tests: move libqtest.h back under qtest/, (continued)
- [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