Hi Markus, On Wed, 2022-03-16 at 15:28 +0100, Markus Armbruster wrote: > Nicolas Saenz Julienne <nsaen...@redhat.com> writes: > > > 'event-loop-base' provides basic property handling for all 'AioContext' > > based event loops. So let's define a new 'MainLoopClass' that inherits > > from it. This will permit tweaking the main loop's properties through > > qapi as well as through the command line using the '-object' keyword[1]. > > Only one instance of 'MainLoopClass' might be created at any time. > > > > 'EventLoopBaseClass' learns a new callback, 'can_be_deleted()' so as to > > mark 'MainLoop' as non-deletable. > > > > [1] For example: > > -object main-loop,id=main-loop,aio-max-batch=<value> > > > > Signed-off-by: Nicolas Saenz Julienne <nsaen...@redhat.com> > > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > > [...] > > > diff --git a/qapi/qom.json b/qapi/qom.json > > index eeb5395ff3..10800166e8 100644 > > --- a/qapi/qom.json > > +++ b/qapi/qom.json > > @@ -528,6 +528,19 @@ > > '*poll-shrink': 'int', > > '*aio-max-batch': 'int' } } > > > > +## > > +# @MainLoopProperties: > > +# > > +# Properties for the main-loop object. > > +# > > +# @aio-max-batch: maximum number of requests in a batch for the AIO engine, > > +# 0 means that the engine will use its default (default:0) > > +# > > +# Since: 7.1 > > +## > > +{ 'struct': 'MainLoopProperties', > > + 'data': { '*aio-max-batch': 'int' } } > > + > > IothreadProperties has the same member, with the same documentation. > > Do main loop and iothreads have a common ancestor, conceptually? > > If yes, it might make sense for MainLoopProperties and > IothreadProperties to have a common base type, and put @aio-max-batch > there. This is not a demand.
Yes it could make sense, in terms of the QOM they both inherit from the same base abstract class, called EventLoopBase. On top of that, patch #3 adds two more common properties. So doing so would avoid some amount of duplication. I'll look into it and prepare a v4 of the series. Thanks! -- Nicolás Sáenz