[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 25/26] tests: replace qemu_set_nonblock()
From: |
marcandre . lureau |
Subject: |
[PATCH v2 25/26] tests: replace qemu_set_nonblock() |
Date: |
Tue, 26 Apr 2022 13:27:14 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The call is POSIX-specific. Use the dedicated GLib API.
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:
--
2.36.0
- [PATCH v2 16/26] io: replace pipe() with g_unix_open_pipe(CLOEXEC), (continued)
- [PATCH v2 16/26] io: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/04/26
- [PATCH v2 15/26] virtiofsd: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/04/26
- [PATCH v2 19/26] chardev: replace qemu_set_nonblock(), marcandre . lureau, 2022/04/26
- [PATCH v2 18/26] io: make qio_channel_command_new_pid() static, marcandre . lureau, 2022/04/26
- [PATCH v2 20/26] io: replace qemu_set{_non}block(), marcandre . lureau, 2022/04/26
- [PATCH v2 22/26] hw: replace qemu_set_nonblock(), marcandre . lureau, 2022/04/26
- [PATCH v2 21/26] qga: replace qemu_set_nonblock(), marcandre . lureau, 2022/04/26
- [PATCH v2 23/26] ui: replace qemu_set_nonblock(), marcandre . lureau, 2022/04/26
- [PATCH v2 24/26] net: replace qemu_set_nonblock(), marcandre . lureau, 2022/04/26
- [PATCH v2 25/26] tests: replace qemu_set_nonblock(),
marcandre . lureau <=
- [PATCH v2 26/26] util: rename qemu_*block() socket functions, marcandre . lureau, 2022/04/26