[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/25] slirp: open-code qemu_socket_(un)select()
From: |
marcandre . lureau |
Subject: |
[PULL 12/25] slirp: open-code qemu_socket_(un)select() |
Date: |
Mon, 13 Mar 2023 15:43:22 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
net/slirp.c | 10 +++++++---
1 file 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
}
--
2.39.2
- [PULL 01/25] util: drop qemu_fork(), (continued)
- [PULL 01/25] util: drop qemu_fork(), marcandre . lureau, 2023/03/13
- [PULL 02/25] tests: use closesocket(), marcandre . lureau, 2023/03/13
- [PULL 03/25] io: use closesocket(), marcandre . lureau, 2023/03/13
- [PULL 04/25] tests: add test-error-report, marcandre . lureau, 2023/03/13
- [PULL 05/25] error: add global &error_warn destination, marcandre . lureau, 2023/03/13
- [PULL 06/25] win32/socket: introduce qemu_socket_select() helper, marcandre . lureau, 2023/03/13
- [PULL 07/25] win32/socket: introduce qemu_socket_unselect() helper, marcandre . lureau, 2023/03/13
- [PULL 08/25] aio: make aio_set_fd_poll() static to aio-posix.c, marcandre . lureau, 2023/03/13
- [PULL 09/25] aio/win32: aio_set_fd_handler() only supports SOCKET, marcandre . lureau, 2023/03/13
- [PULL 10/25] main-loop: remove qemu_fd_register(), win32/slirp/socket specific, marcandre . lureau, 2023/03/13
- [PULL 12/25] slirp: open-code qemu_socket_(un)select(),
marcandre . lureau <=
- [PULL 11/25] slirp: unregister the win32 SOCKET, marcandre . lureau, 2023/03/13
- [PULL 13/25] win32: avoid mixing SOCKET and file descriptor space, marcandre . lureau, 2023/03/13
- [PULL 15/25] win32: replace closesocket() with close() wrapper, marcandre . lureau, 2023/03/13
- [PULL 14/25] os-posix: remove useless ioctlsocket() define, marcandre . lureau, 2023/03/13
- [PULL 16/25] tests: fix path separator, use g_build_filename(), marcandre . lureau, 2023/03/13
- [PULL 17/25] char: do not double-close fd when failing to add client, marcandre . lureau, 2023/03/13
- [PULL 18/25] tests/docker: fix a win32 error due to portability, marcandre . lureau, 2023/03/13
- [PULL 19/25] osdep: implement qemu_socketpair() for win32, marcandre . lureau, 2023/03/13
- [PULL 21/25] monitor: release the lock before calling close(), marcandre . lureau, 2023/03/13
- [PULL 20/25] qmp: 'add_client' actually expects sockets, marcandre . lureau, 2023/03/13