[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/23] qga: replace qemu_set_nonblock()
From: |
marcandre . lureau |
Subject: |
[PULL 18/23] qga: replace qemu_set_nonblock() |
Date: |
Tue, 3 May 2022 17:00:18 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The call is POSIX-specific. Use the dedicated GLib API.
(this is a preliminary patch before renaming qemu_set_nonblock())
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
qga/commands-posix.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 094487c2c395..78f2f210015d 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -404,7 +404,11 @@ int64_t qmp_guest_file_open(const char *path, bool
has_mode, const char *mode,
/* set fd non-blocking to avoid common use cases (like reading from a
* named pipe) from hanging the agent
*/
- qemu_set_nonblock(fileno(fh));
+ if (!g_unix_set_fd_nonblocking(fileno(fh), true, NULL)) {
+ fclose(fh);
+ error_setg_errno(errp, errno, "Failed to set FD nonblocking");
+ return -1;
+ }
handle = guest_file_handle_add(fh, errp);
if (handle < 0) {
--
2.36.0.44.g0f828332d5ac
- [PULL 01/23] Use QEMU_SANITIZE_THREAD, (continued)
- [PULL 01/23] Use QEMU_SANITIZE_THREAD, marcandre . lureau, 2022/05/03
- [PULL 07/23] Replace qemu_pipe() with g_unix_open_pipe(), marcandre . lureau, 2022/05/03
- [PULL 19/23] hw: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 06/23] block: move fcntl_setfl(), marcandre . lureau, 2022/05/03
- [PULL 09/23] qga: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 20/23] ui: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 03/23] tests: move libqtest.h back under qtest/, marcandre . lureau, 2022/05/03
- [PULL 17/23] io: replace qemu_set{_non}block(), marcandre . lureau, 2022/05/03
- [PULL 23/23] util: rename qemu_*block() socket functions, marcandre . lureau, 2022/05/03
- [PULL 21/23] net: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 18/23] qga: replace qemu_set_nonblock(),
marcandre . lureau <=
- [PULL 15/23] io: make qio_channel_command_new_pid() static, marcandre . lureau, 2022/05/03
- [PULL 11/23] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 00/23] Misc patches, marcandre . lureau, 2022/05/03
- [PULL 19/23] hw: replace qemu_set_nonblock(), marcandre . lureau, 2022/05/03
- [PULL 09/23] qga: replace pipe() with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- Re: [PULL 00/23] Misc patches, Richard Henderson, 2022/05/03
- [PULL 11/23] os-posix: replace pipe()+cloexec with g_unix_open_pipe(CLOEXEC), marcandre . lureau, 2022/05/03
- [PULL 03/23] tests: move libqtest.h back under qtest/, marcandre . lureau, 2022/05/03
- [PULL 01/23] Use QEMU_SANITIZE_THREAD, marcandre . lureau, 2022/05/03
- [PULL 15/23] io: make qio_channel_command_new_pid() static, marcandre . lureau, 2022/05/03