main-loop: remove qemu_fd_register(), win32/slirp/socket specific

Open-code the socket registration where it's needed, to avoid
artificially used or unclear generic interface.

Furthermore, the following patches are going to make socket handling use
FD-only inside QEMU, but we need to handle win32 SOCKET from libslirp.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Message-Id: <20230221124802.4103554-12-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2023-02-21 16:47:56 +04:00
parent e2a3a2193e
commit faa4ec1641
3 changed files with 7 additions and 14 deletions

View file

@ -248,7 +248,13 @@ static void net_slirp_timer_mod(void *timer, int64_t expire_timer,
static void net_slirp_register_poll_fd(int fd, void *opaque)
{
qemu_fd_register(fd);
#ifdef WIN32
AioContext *ctxt = qemu_get_aio_context();
qemu_socket_select(fd, event_notifier_get_handle(&ctxt->notifier),
FD_READ | FD_ACCEPT | FD_CLOSE |
FD_CONNECT | FD_WRITE | FD_OOB, NULL);
#endif
}
static void net_slirp_unregister_poll_fd(int fd, void *opaque)