@@ -1767,7 +1767,7 @@ static int udp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
return send(s->fd, (const void *)buf, len, 0);
}
-static int udp_chr_read_poll(void *opaque)
+static void udp_chr_read(void *opaque)
{
CharDriverState *chr = opaque;
NetCharDriver *s = chr->opaque;
@@ -1782,14 +1782,6 @@ static int udp_chr_read_poll(void *opaque)
s->bufptr++;
s->max_size = qemu_chr_can_read(chr);
}
- return s->max_size;
-}
-
-static void udp_chr_read(void *opaque)
-{
- CharDriverState *chr = opaque;
- NetCharDriver *s = chr->opaque;
-
if (s->max_size == 0)
return;
s->bufcnt = recv(s->fd, (void *)s->buf, sizeof(s->buf), 0);
@@ -1810,8 +1802,7 @@ static void udp_chr_update_read_handler(CharDriverState *chr)
NetCharDriver *s = chr->opaque;
if (s->fd >= 0) {
- qemu_set_fd_handler2(s->fd, udp_chr_read_poll,
- udp_chr_read, NULL, chr);
+ qemu_set_fd_handler(s->fd, udp_chr_read, NULL, chr);
}
}
This way we can remove the poll test Signed-off-by: Juan Quintela <quintela@redhat.com> --- qemu-char.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-)