All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 08/10] Use g_unix_set_fd_nonblocking()
Date: Fri, 22 Apr 2022 09:56:06 +0100	[thread overview]
Message-ID: <YmJtpgNzy3omF0+V@redhat.com> (raw)
In-Reply-To: <20220422083639.3156978-9-marcandre.lureau@redhat.com>

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	other threads:[~2022-04-22  9:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  8:36 [PATCH 00/10] Misc cleanups marcandre.lureau
2022-04-22  8:36 ` [PATCH 01/10] Use QEMU_SANITIZE_THREAD marcandre.lureau
2022-04-22  8:36 ` [PATCH 02/10] Use QEMU_SANITIZE_ADDRESS marcandre.lureau
2022-04-22  8:36 ` [PATCH 03/10] include: move qemu_*_exec_dir() to cutils marcandre.lureau
2022-04-22  8:36 ` [PATCH 04/10] tests: move libqtest.h back under qtest/ marcandre.lureau
2022-04-25 19:32   ` Thomas Huth
2022-04-22  8:36 ` [PATCH 05/10] libqtest: split QMP part in libqmp marcandre.lureau
2022-04-25 19:39   ` Thomas Huth
2022-04-22  8:36 ` [PATCH 06/10] Replace qemu_pipe() with g_unix_open_pipe() marcandre.lureau
2022-04-22  8:59   ` Daniel P. Berrangé
2022-04-22  9:09     ` Marc-André Lureau
2022-04-22  8:36 ` [PATCH 07/10] tests: make libqmp buildable for win32 marcandre.lureau
2022-04-22  8:36 ` [PATCH 08/10] Use g_unix_set_fd_nonblocking() marcandre.lureau
2022-04-22  8:56   ` Daniel P. Berrangé [this message]
2022-04-22  9:06     ` Marc-André Lureau
2022-04-22 14:24   ` Eric Blake
2022-04-22 14:27     ` Marc-André Lureau
2022-04-22  8:36 ` [PATCH 09/10] block: move fcntl_setfl() marcandre.lureau
2022-04-22 12:20   ` Richard Henderson
2022-04-22  8:36 ` [PATCH 10/10] util/win32: simplify qemu_get_local_state_dir() marcandre.lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmJtpgNzy3omF0+V@redhat.com \
    --to=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.