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 f9e8cacc55 ("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>
This commit is contained in:
Marc-André Lureau 2022-04-25 17:33:47 +04:00
parent b2670d1f99
commit ff5927baa7
14 changed files with 32 additions and 32 deletions

View file

@ -297,7 +297,7 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr,
}
}
qemu_set_nonblock(fd);
qemu_socket_set_nonblock(fd);
return fd;
fail:
if (fd >= 0)
@ -522,7 +522,7 @@ static int net_socket_listen_init(NetClientState *peer,
error_setg_errno(errp, errno, "can't create stream socket");
return -1;
}
qemu_set_nonblock(fd);
qemu_socket_set_nonblock(fd);
socket_set_fast_reuse(fd);
@ -570,7 +570,7 @@ static int net_socket_connect_init(NetClientState *peer,
error_setg_errno(errp, errno, "can't create stream socket");
return -1;
}
qemu_set_nonblock(fd);
qemu_socket_set_nonblock(fd);
connected = 0;
for(;;) {
@ -688,7 +688,7 @@ static int net_socket_udp_init(NetClientState *peer,
closesocket(fd);
return -1;
}
qemu_set_nonblock(fd);
qemu_socket_set_nonblock(fd);
s = net_socket_fd_init(peer, model, name, fd, 0, NULL, errp);
if (!s) {
@ -730,7 +730,7 @@ int net_init_socket(const Netdev *netdev, const char *name,
if (fd == -1) {
return -1;
}
ret = qemu_try_set_nonblock(fd);
ret = qemu_socket_try_set_nonblock(fd);
if (ret < 0) {
error_setg_errno(errp, -ret, "%s: Can't use file descriptor %d",
name, fd);