diff options
author | Marc-André Lureau | 2019-01-17 12:43:41 +0100 |
---|---|---|
committer | Samuel Thibault | 2019-02-07 14:49:08 +0100 |
commit | 848c7092ba69318e7bc72a9c0c1f6cd443c439ad (patch) | |
tree | a5f4a80e8be467676ce6d8dce38dc4dc6669bf8d /net/slirp.c | |
parent | slirp: replace most qemu socket utilities with slirp own version (diff) | |
download | qemu-848c7092ba69318e7bc72a9c0c1f6cd443c439ad.tar.gz qemu-848c7092ba69318e7bc72a9c0c1f6cd443c439ad.tar.xz qemu-848c7092ba69318e7bc72a9c0c1f6cd443c439ad.zip |
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/slirp.c')
-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, |