diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-01-17 15:43:41 +0400 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-02-07 15:49:08 +0200 |
commit | 848c7092ba69318e7bc72a9c0c1f6cd443c439ad (patch) | |
tree | a5f4a80e8be467676ce6d8dce38dc4dc6669bf8d /net | |
parent | 707bd47ef3cf778b691d9e0df2ede3ec4c3fe771 (diff) |
slirp: replace qemu_set_nonblock()
Replace qemu_set_nonblock() with slirp_set_nonblock()
qemu_set_nonblock() does some event registration with the main
loop. Add a new callback register_poll_fd() for that reason.
Always build the fd-register stub, to avoid #if WIN32.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/slirp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/slirp.c b/net/slirp.c index c24a779425..6f756a4dcc 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -186,6 +186,11 @@ static void net_slirp_timer_mod(void *timer, int64_t expire_timer) timer_mod(timer, expire_timer); } +static void net_slirp_register_poll_fd(int fd) +{ + qemu_fd_register(fd); +} + static const SlirpCb slirp_cb = { .output = net_slirp_output, .guest_error = net_slirp_guest_error, @@ -193,6 +198,7 @@ static const SlirpCb slirp_cb = { .timer_new = net_slirp_timer_new, .timer_free = net_slirp_timer_free, .timer_mod = net_slirp_timer_mod, + .register_poll_fd = net_slirp_register_poll_fd, }; static int net_slirp_init(NetClientState *peer, const char *model, |