From: Nicolas Saenz Julienne <nsaenzju@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, fam@euphon.net, berrange@redhat.com,
qemu-block@nongnu.org, michael.roth@amd.com, mtosatti@redhat.com,
qemu-devel@nongnu.org, eduardo@habkost.net, hreitz@redhat.com,
stefanha@redhat.com, pbonzini@redhat.com, eblake@redhat.com
Subject: Re: [PATCH v3 2/3] util/main-loop: Introduce the main loop into QOM
Date: Tue, 29 Mar 2022 13:30:56 +0200 [thread overview]
Message-ID: <fb2014811c7c7c26c598f4144dc8bb97bbd80465.camel@redhat.com> (raw)
In-Reply-To: <877d8uug2e.fsf@pond.sub.org>
Hi Markus,
On Wed, 2022-03-16 at 15:28 +0100, Markus Armbruster wrote:
> Nicolas Saenz Julienne <nsaenzju@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 <nsaenzju@redhat.com>
> > Reviewed-by: Stefan Hajnoczi <stefanha@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
next prev parent reply other threads:[~2022-03-29 11:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 13:53 [PATCH v3 0/3] util/thread-pool: Expose minimun and maximum size Nicolas Saenz Julienne
2022-03-16 13:53 ` [PATCH v3 1/3] Introduce event-loop-base abstract class Nicolas Saenz Julienne
2022-03-16 13:53 ` [PATCH v3 2/3] util/main-loop: Introduce the main loop into QOM Nicolas Saenz Julienne
2022-03-16 14:28 ` Markus Armbruster
2022-03-29 11:30 ` Nicolas Saenz Julienne [this message]
2022-03-16 13:53 ` [PATCH v3 3/3] util/event-loop-base: Introduce options to set the thread pool size Nicolas Saenz Julienne
2022-03-30 12:22 ` [PATCH v3 0/3] util/thread-pool: Expose minimun and maximum size Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fb2014811c7c7c26c598f4144dc8bb97bbd80465.camel@redhat.com \
--to=nsaenzju@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=fam@euphon.net \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=michael.roth@amd.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).