Skip to content

Commit

Permalink
slirp: open-code qemu_socket_(un)select()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
elmarco committed Mar 13, 2023
1 parent 21ac728 commit fd3c333
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions net/slirp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit fd3c333

Please sign in to comment.