Skip to content
Snippets Groups Projects
Commit fd3c3333 authored by Marc-André Lureau's avatar Marc-André Lureau
Browse files

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: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
Message-Id: <20230221124802.4103554-14-marcandre.lureau@redhat.com>
parent 21ac7284
No related branches found
No related tags found
No related merge requests found
...@@ -251,16 +251,20 @@ static void net_slirp_register_poll_fd(int fd, void *opaque) ...@@ -251,16 +251,20 @@ static void net_slirp_register_poll_fd(int fd, void *opaque)
#ifdef WIN32 #ifdef WIN32
AioContext *ctxt = qemu_get_aio_context(); 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_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 #endif
} }
static void net_slirp_unregister_poll_fd(int fd, void *opaque) static void net_slirp_unregister_poll_fd(int fd, void *opaque)
{ {
#ifdef WIN32 #ifdef WIN32
qemu_socket_unselect(fd, NULL); if (WSAEventSelect(fd, NULL, 0) != 0) {
error_setg_win32(&error_warn, WSAGetLastError(), "failed to WSAEventSelect()");
}
#endif #endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment