> > +aio_set_fd_handler(ctx, fd, false, (IOHandler *)qemu_coroutine_enter,
> > + NULL, NULL, qemu_coroutine_self());
>
> This cast is unsafe. If qemu_coroutine_enter()'s prototype is changed
> there will be no compiler warning that the prototypes are now
> incompatible.
On Mon, Oct 21, 2019 at 10:50:55AM +0200, Dietmar Maurer wrote:
> -static void fd_coroutine_enter(void *opaque)
> -{
> -FDYieldUntilData *data = opaque;
> -qemu_set_fd_handler(data->fd, NULL, NULL, NULL);
> -qemu_coroutine_enter(data->co);
> -}
> -
> void coroutine_fn
Simply use qemu_get_current_aio_context().
Signed-off-by: Dietmar Maurer
---
Changelog for v3:
- use (IOHandler *) instead of ((void (*)(void *))
- coding style: fix max line length
Changelog for v2:
- use correct read handler in aio_set_fd_handler (instead of write handler)