aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-02-21 16:47:58 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-03-13 15:39:31 +0400
commitfd3c3333157a8121e4ba9485677ef5860f8fb2db (patch)
tree4d24d4cad78476f8e4392714c293f3f872562dbb
parent21ac728498c1d529dd0abde1054703946be163da (diff)
slirp: open-code qemu_socket_(un)select()
We are about to make the QEMU socket API use file-descriptor space only, but libslirp gives us SOCKET as fd, still. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-14-marcandre.lureau@redhat.com>
-rw-r--r--net/slirp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/slirp.c b/net/slirp.c
index a7c35778a6..c33b3e02e7 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -251,16 +251,20 @@ static void net_slirp_register_poll_fd(int fd, void *opaque)
#ifdef WIN32
AioContext *ctxt = qemu_get_aio_context();
- qemu_socket_select(fd, event_notifier_get_handle(&ctxt->notifier),
+ if (WSAEventSelect(fd, event_notifier_get_handle(&ctxt->notifier),
FD_READ | FD_ACCEPT | FD_CLOSE |
- FD_CONNECT | FD_WRITE | FD_OOB, NULL);
+ FD_CONNECT | FD_WRITE | FD_OOB) != 0) {
+ error_setg_win32(&error_warn, WSAGetLastError(), "failed to WSAEventSelect()");
+ }
#endif
}
static void net_slirp_unregister_poll_fd(int fd, void *opaque)
{
#ifdef WIN32
- qemu_socket_unselect(fd, NULL);
+ if (WSAEventSelect(fd, NULL, 0) != 0) {
+ error_setg_win32(&error_warn, WSAGetLastError(), "failed to WSAEventSelect()");
+ }
#endif
}