Am 10.09.2025 um 19:56 hat Stefan Hajnoczi geschrieben: > When aio_context_new() -> aio_context_setup() fails at startup it > doesn't really matter whether errors are returned to the caller or the > process terminates immediately. > > However, it is not acceptable to terminate when hotplugging --object > iothread at runtime. Refactor aio_context_setup() so that errors can be > propagated. The next commit will set errp when fdmon_io_uring_setup() > fails. > > Suggested-by: Kevin Wolf <[email protected]> > Signed-off-by: Stefan Hajnoczi <[email protected]> > Reviewed-by: Eric Blake <[email protected]>
> diff --git a/include/block/aio.h b/include/block/aio.h > index 2760f308f5..d919d7c8f4 100644 > --- a/include/block/aio.h > +++ b/include/block/aio.h > @@ -718,10 +718,11 @@ void qemu_set_current_aio_context(AioContext *ctx); > /** > * aio_context_setup: > * @ctx: the aio context > + * @errp: error pointer > * > * Initialize the aio context. > */ > -void aio_context_setup(AioContext *ctx); > +void aio_context_setup(AioContext *ctx, Error **errp); I don't really mind much, but the convention these days is that functions don't only take an Error **, but also return a bool or 0/-errno. Reviewed-by: Kevin Wolf <[email protected]>
