chardev: replace qemu_set_nonblock()

Those calls are either for non-socket fd, or are POSIX-specific. Use the
dedicated GLib API. (qemu_set_nonblock() is for socket-like)

(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>
This commit is contained in:
Marc-André Lureau 2022-04-25 17:39:06 +04:00
parent 05e50e8fe5
commit b84bb4dfe5
4 changed files with 14 additions and 5 deletions

View file

@ -212,8 +212,8 @@ void qemu_chr_open_fd(Chardev *chr,
FDChardev *s = FD_CHARDEV(chr);
g_autofree char *name = NULL;
if (fd_out >= 0) {
qemu_set_nonblock(fd_out);
if (fd_out >= 0 && !g_unix_set_fd_nonblocking(fd_out, true, NULL)) {
assert(!"Failed to set FD nonblocking");
}
if (fd_out == fd_in && fd_in >= 0) {