From: Thomas Huth <thuth@redhat.com>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: "Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH v2 25/26] tests: replace qemu_set_nonblock()
Date: Wed, 27 Apr 2022 11:41:02 +0200 [thread overview]
Message-ID: <1a33c268-6d00-4385-f0d2-84a86b022f63@redhat.com> (raw)
In-Reply-To: <20220426092715.3931705-26-marcandre.lureau@redhat.com>
On 26/04/2022 11.27, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The call is POSIX-specific. Use the dedicated GLib API.
g_unix_set_fd_nonblocking() is also available on Unix-like systems according
to its name, I suppose? So what's the advantage of this change?
Thomas
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> tests/qtest/vhost-user-test.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
> index ee30f5479648..a2cec8768462 100644
> --- a/tests/qtest/vhost-user-test.c
> +++ b/tests/qtest/vhost-user-test.c
> @@ -302,6 +302,7 @@ static int chr_can_read(void *opaque)
>
> static void chr_read(void *opaque, const uint8_t *buf, int size)
> {
> + g_autoptr(GError) err = NULL;
> TestServer *s = opaque;
> CharBackend *chr = &s->chr;
> VhostUserMsg msg;
> @@ -394,7 +395,8 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
> * The receive function forces it to be blocking,
> * so revert it back to non-blocking.
> */
> - qemu_set_nonblock(fd);
> + g_unix_set_fd_nonblocking(fd, true, &err);
> + g_assert_no_error(err);
> break;
>
> case VHOST_USER_SET_LOG_BASE:
next prev parent reply other threads:[~2022-04-27 9:45 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 9:26 [PATCH v2 00/26] Misc cleanups marcandre.lureau
2022-04-26 9:26 ` [PATCH v2 01/26] Use QEMU_SANITIZE_THREAD marcandre.lureau
2022-04-26 20:43 ` Richard Henderson
2022-04-27 7:59 ` Marc-André Lureau
2022-04-26 9:26 ` [PATCH v2 02/26] Use QEMU_SANITIZE_ADDRESS marcandre.lureau
2022-04-26 20:46 ` Richard Henderson
2022-04-27 9:36 ` Thomas Huth
2022-04-26 9:26 ` [PATCH v2 03/26] include: move qemu_*_exec_dir() to cutils marcandre.lureau
2022-04-26 9:26 ` [PATCH v2 04/26] util/win32: simplify qemu_get_local_state_dir() marcandre.lureau
2022-04-26 9:26 ` [PATCH v2 05/26] tests: move libqtest.h back under qtest/ marcandre.lureau
2022-04-26 10:30 ` Stefan Berger
2022-05-30 14:41 ` Juan Quintela
2022-04-26 9:26 ` [PATCH v2 06/26] libqtest: split QMP part in libqmp marcandre.lureau
2022-04-26 9:26 ` [PATCH v2 07/26] tests: make libqmp buildable for win32 marcandre.lureau
2022-04-26 9:32 ` Thomas Huth
2022-04-26 10:25 ` Marc-André Lureau
2022-04-26 10:29 ` Thomas Huth
2022-04-26 9:26 ` [PATCH v2 08/26] Use g_unix_set_fd_nonblocking() marcandre.lureau
2022-04-27 1:00 ` Richard Henderson
2022-04-26 9:26 ` [PATCH v2 09/26] block: move fcntl_setfl() marcandre.lureau
2022-04-27 1:00 ` Richard Henderson
2022-04-26 9:26 ` [PATCH v2 10/26] Replace qemu_pipe() with g_unix_open_pipe() marcandre.lureau
2022-04-27 1:06 ` Richard Henderson
2022-04-26 9:27 ` [PATCH v2 11/26] util: replace pipe()+cloexec " marcandre.lureau
2022-04-27 1:06 ` Richard Henderson
2022-04-26 9:27 ` [PATCH v2 12/26] qga: replace pipe() with g_unix_open_pipe(CLOEXEC) marcandre.lureau
2022-04-27 1:08 ` Richard Henderson
2022-04-27 8:24 ` Marc-André Lureau
2022-05-03 11:22 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 13/26] tests: " marcandre.lureau
2022-05-03 10:11 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 14/26] os-posix: replace pipe()+cloexec " marcandre.lureau
2022-04-27 1:11 ` Richard Henderson
2022-04-26 9:27 ` [PATCH v2 15/26] virtiofsd: replace pipe() " marcandre.lureau
2022-05-03 10:16 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 16/26] io: " marcandre.lureau
2022-05-03 10:29 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 17/26] Replace fcntl(0_NONBLOCK) with g_unix_set_fd_nonblocking() marcandre.lureau
2022-04-27 1:15 ` Richard Henderson
2022-04-27 9:08 ` Marc-André Lureau
2022-04-26 9:27 ` [PATCH v2 18/26] io: make qio_channel_command_new_pid() static marcandre.lureau
2022-04-27 1:15 ` Richard Henderson
2022-04-26 9:27 ` [PATCH v2 19/26] chardev: replace qemu_set_nonblock() marcandre.lureau
2022-05-03 10:32 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 20/26] io: replace qemu_set{_non}block() marcandre.lureau
2022-05-03 10:33 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 21/26] qga: replace qemu_set_nonblock() marcandre.lureau
2022-05-03 10:35 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 22/26] hw: " marcandre.lureau
2022-05-03 10:38 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 23/26] ui: " marcandre.lureau
2022-05-03 10:41 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 24/26] net: " marcandre.lureau
2022-05-03 10:42 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 25/26] tests: " marcandre.lureau
2022-04-27 9:41 ` Thomas Huth [this message]
2022-04-27 10:33 ` Marc-André Lureau
2022-04-27 11:15 ` Thomas Huth
2022-05-03 10:44 ` Daniel P. Berrangé
2022-04-26 9:27 ` [PATCH v2 26/26] util: rename qemu_*block() socket functions marcandre.lureau
2022-04-26 10:28 ` Marc-André Lureau
2022-04-26 14:33 ` Stefan Hajnoczi
2022-04-27 10:39 ` Marc-André Lureau
2022-05-02 7:45 ` [PATCH v2 00/26] Misc cleanups Marc-André 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=1a33c268-6d00-4385-f0d2-84a86b022f63@redhat.com \
--to=thuth@redhat.com \
--cc=berrange@redhat.com \
--cc=lvivier@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).