diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-25 17:39:06 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-03 15:52:29 +0400 |
commit | b0a8f9adfed871728154b0064a28e34b6670f9f2 (patch) | |
tree | 5967bbcc702c998fc82044425d99b214468b8006 /qga | |
parent | 17fc124529abfda185e69fa1220e5f404be22d25 (diff) |
qga: replace qemu_set_nonblock()
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>
Diffstat (limited to 'qga')
-rw-r--r-- | qga/commands-posix.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 094487c2c3..78f2f21001 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) { |