diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-04-25 17:33:47 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-03 15:53:20 +0400 |
commit | ff5927baa7ffb9c97873a071f6a8d85a3584182b (patch) | |
tree | fac232e795ec7f76ad8ca15a59a7d8b908e7a225 /util/oslib-posix.c | |
parent | b2670d1f9976260191ebccecc822fea7114fd448 (diff) | |
download | qemu-ff5927baa7ffb9c97873a071f6a8d85a3584182b.zip qemu-ff5927baa7ffb9c97873a071f6a8d85a3584182b.tar.gz qemu-ff5927baa7ffb9c97873a071f6a8d85a3584182b.tar.bz2 |
util: rename qemu_*block() socket functions
The qemu_*block() functions are meant to be be used with sockets (the
win32 implementation expects SOCKET)
Over time, those functions where used with Win32 SOCKET or
file-descriptors interchangeably. But for portability, they must only be
used with socket-like file-descriptors. FDs can use
g_unix_set_fd_nonblocking() instead.
Rename the functions with "socket" in the name to prevent bad usages.
This is effectively reverting commit f9e8cacc5557e43 ("oslib-posix:
rename socket_set_nonblock() to qemu_set_nonblock()").
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util/oslib-posix.c')
-rw-r--r-- | util/oslib-posix.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 72f25e5..477990f 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -224,20 +224,20 @@ void qemu_anon_ram_free(void *ptr, size_t size) qemu_ram_munmap(-1, ptr, size); } -void qemu_set_block(int fd) +void qemu_socket_set_block(int fd) { g_unix_set_fd_nonblocking(fd, false, NULL); } -int qemu_try_set_nonblock(int fd) +int qemu_socket_try_set_nonblock(int fd) { return g_unix_set_fd_nonblocking(fd, true, NULL) ? 0 : -errno; } -void qemu_set_nonblock(int fd) +void qemu_socket_set_nonblock(int fd) { int f; - f = qemu_try_set_nonblock(fd); + f = qemu_socket_try_set_nonblock(fd); assert(f == 0); } |