Am 20.02.2019 um 19:01 hat Paolo Bonzini geschrieben: > On 20/02/19 18:48, Kevin Wolf wrote: > > -static void qio_channel_set_aio_fd_handlers(QIOChannel *ioc); > > - > > static void qio_channel_restart_read(void *opaque) > > { > > QIOChannel *ioc = opaque; > > Coroutine *co = ioc->read_coroutine; > > > > - ioc->read_coroutine = NULL; > > - qio_channel_set_aio_fd_handlers(ioc); > > - aio_co_wake(co); > > + assert(qemu_get_current_aio_context() == > > + qemu_coroutine_get_aio_context(co)); > > + qemu_coroutine_enter(co); > > } > > > > static void qio_channel_restart_write(void *opaque) > > @@ -417,9 +415,9 @@ static void qio_channel_restart_write(void *opaque) > > QIOChannel *ioc = opaque; > > Coroutine *co = ioc->write_coroutine; > > > > - ioc->write_coroutine = NULL; > > - qio_channel_set_aio_fd_handlers(ioc); > > - aio_co_wake(co); > > + assert(qemu_get_current_aio_context() == > > + qemu_coroutine_get_aio_context(co)); > > + qemu_coroutine_enter(co); > > } > > > > static void qio_channel_set_aio_fd_handlers(QIOChannel *ioc) > > > > aio_co_wake was also acquiring/releasing the AioContext, so > that needs to stay for now.
True. Maybe I should leave the aio_co_wake call alone() and just add the assertion to avoid complicating the code rather than simplifying it... Kevin