summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-25 17:33:47 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-05-03 15:53:20 +0400
commitff5927baa7ffb9c97873a071f6a8d85a3584182b (patch)
treefac232e795ec7f76ad8ca15a59a7d8b908e7a225 /hw
parentb2670d1f9976260191ebccecc822fea7114fd448 (diff)
downloadfocaccia-qemu-ff5927baa7ffb9c97873a071f6a8d85a3584182b.tar.gz
focaccia-qemu-ff5927baa7ffb9c97873a071f6a8d85a3584182b.zip
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 'hw')
-rw-r--r--hw/hyperv/syndbg.c2
-rw-r--r--hw/virtio/vhost-user.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/hw/hyperv/syndbg.c b/hw/hyperv/syndbg.c
index ebb8a29f78..16d04cfdc6 100644
--- a/hw/hyperv/syndbg.c
+++ b/hw/hyperv/syndbg.c
@@ -334,7 +334,7 @@ static void hv_syndbg_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    qemu_set_nonblock(syndbg->socket);
+    qemu_socket_set_nonblock(syndbg->socket);
 
     syndbg->servaddr.sin_port = htons(syndbg->host_port);
     syndbg->servaddr.sin_family = AF_INET;
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 9c4f84f35f..a80315ecfc 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -1826,7 +1826,7 @@ static int vhost_user_postcopy_advise(struct vhost_dev *dev, Error **errp)
         error_setg(errp, "%s: Failed to get ufd", __func__);
         return -EIO;
     }
-    qemu_set_nonblock(ufd);
+    qemu_socket_set_nonblock(ufd);
 
     /* register ufd with userfault thread */
     u->postcopy_fd.fd = ufd;