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:51:52 +0400 |
commit | b84bb4dfe5d03b40c91260db8ee07d65809fc35f (patch) | |
tree | 16e770c0a41aa2cd5a848572633b3b9f7a8d2359 /chardev/char-serial.c | |
parent | 05e50e8fe5fed707653e1e5e2f2871f253a70452 (diff) | |
download | qemu-b84bb4dfe5d03b40c91260db8ee07d65809fc35f.zip qemu-b84bb4dfe5d03b40c91260db8ee07d65809fc35f.tar.gz qemu-b84bb4dfe5d03b40c91260db8ee07d65809fc35f.tar.bz2 |
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>
Diffstat (limited to 'chardev/char-serial.c')
-rw-r--r-- | chardev/char-serial.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chardev/char-serial.c b/chardev/char-serial.c index 7c3d84a..4b0b83d 100644 --- a/chardev/char-serial.c +++ b/chardev/char-serial.c @@ -271,7 +271,10 @@ static void qmp_chardev_open_serial(Chardev *chr, if (fd < 0) { return; } - qemu_set_nonblock(fd); + if (!g_unix_set_fd_nonblocking(fd, true, NULL)) { + error_setg_errno(errp, errno, "Failed to set FD nonblocking"); + return; + } tty_serial_init(fd, 115200, 'N', 8, 1); qemu_chr_open_fd(chr, fd, fd); |