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 a2439533c5..51f3acaad8 100644 > --- a/qapi/qom.json > +++ b/qapi/qom.json > @@ -540,6 +540,16 @@ > '*poll-grow': 'int', > '*poll-shrink': 'int' } } > > +## > +# @MainLoopProperties: > +# > +# Properties for the main-loop object. > +# Please add # Since: 7.1 > +## > +{ 'struct': 'MainLoopProperties', > + 'base': 'EventLoopBaseProperties', > + 'data': {} } > + > ## > # @MemoryBackendProperties: > # > @@ -830,6 +840,7 @@ > { 'name': 'input-linux', > 'if': 'CONFIG_LINUX' }, > 'iothread', > + 'main-loop', > { 'name': 'memory-backend-epc', > 'if': 'CONFIG_LINUX' }, > 'memory-backend-file', > @@ -895,6 +906,7 @@ > 'input-linux': { 'type': 'InputLinuxProperties', > 'if': 'CONFIG_LINUX' }, > 'iothread': 'IothreadProperties', > + 'main-loop': 'MainLoopProperties', > 'memory-backend-epc': { 'type': 'MemoryBackendEpcProperties', > 'if': 'CONFIG_LINUX' }, > 'memory-backend-file': 'MemoryBackendFileProperties', [...]