All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: "Markus Armbruster" <armbru@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, "Eric Blake" <eblake@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	qemu-block@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Xie Yongji" <xieyongji@bytedance.com>,
	"Kyle Evans" <kevans@freebsd.org>, "John Snow" <jsnow@redhat.com>,
	"Michael Roth" <michael.roth@amd.com>,
	"Warner Losh" <imp@bsdimp.com>, "Kevin Wolf" <kwolf@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Fam Zheng" <fam@euphon.net>, "Hanna Reitz" <hreitz@redhat.com>
Subject: Re: [PATCH v2 11/15] qemu-common: move scripts/qapi
Date: Fri, 02 Sep 2022 13:15:59 +0200	[thread overview]
Message-ID: <87o7vyt4b4.fsf@pond.sub.org> (raw)
In-Reply-To: <CAJ+F1C+DNUwtdwSgf+aAoAcJ6u_fn=txXfHG9QdGaC8o26cxkg@mail.gmail.com> ("Marc-André Lureau"'s message of "Mon, 22 Aug 2022 12:16:03 +0400")

Marc-André Lureau <marcandre.lureau@gmail.com> writes:

> Hi
>
> On Thu, Aug 11, 2022 at 5:35 PM Markus Armbruster <armbru@redhat.com> wrote:
>
>> Daniel P. Berrangé <berrange@redhat.com> writes:
>>
>> > On Thu, Aug 11, 2022 at 02:50:01PM +0400, Marc-André Lureau wrote:
>> >> Hi
>> >>
>> >> On Thu, Aug 11, 2022 at 2:22 PM Peter Maydell <peter.maydell@linaro.org
>> >
>> >> wrote:
>>
>> [...]
>>
>> >> > As Markus says, your branch ends up moving most of qobject into
>> >> > qemu-common/. We are never going to let that out of QEMU proper,
>> >> > because we are never going to allow ourselves to be tied to API
>> >> > compatibility with it as an external library. So anything that
>> >> >
>> >>
>> >> Why is that? We do it with a lot of dependencies already, with stable
>> APIs.
>> >>
>> >> Furthermore, we don't "have to" be tied to a specific ABI/API, we can
>> >> continue to link statically and compile against a specific version. like
>> >> with libvfio-user today.
>> >>
>> >> And at this point, I am _not_ proposing to have an extra "qemu-common"
>> >> repository. I don't think there are enough reasons to want that either.
>> >>
>> >>
>> >>
>> >> > needs qobject is never going to leave the QEMU codebase. Which
>> >> > means that there's not much gain from shoving it into subproject/
>> >> > IMHO.
>> >>
>> >>
>> >> (just to be extra clear, it's qobject not QOM we are talking about)
>> >>
>> >> qobject is fundamental to all the QAPI related generated code. Why
>> should
>> >> that remain tight to QEMU proper?
>> >
>> > Neither qobject nor QOM have ever been designed to be public APIs.
>> > Though admittedly qobject is quite a bit simpler as an API, I'm
>> > not convinced its current design is something we want to consider
>> > public. As an example, just last month Markus proposed changing
>> > QDict's implementation
>> >
>> > https://lists.gnu.org/archive/html/qemu-devel/2022-07/msg00758.html
>> >
>> >
>> > If we want external projects to be able to take advantage of QAPI,
>> > the bare minimum we need to be public is a QAPI parser, from which
>> > people can then build any code generators desired.
>>
>> Basically scripts/qapi/ less the code generators.
>>
>>
> The generated code is used by qemu-ga & storage daemon, at least. They are
> the first potential consumers, after qemu.
>
>
>> Not sure a subproject would be a good fit.
>>
>
> (I won't repeat the arguments of structuring a project)
>
>
>>
>> Shot from the hip: could the build process spit out something external
>> projects could consume?  It's how "consumables" are commonly delivered.
>> E.g. .so + a bunch of headers.  Sometimes that gets packaged.  Sometimes
>> it gets copied into the consuming tree ("vendored").
>>
>>
> Not sure I follow, but that's just the "install" step isn't it ?
>
> Sure, we could have a "qemu-devel", that ships qapi-gen, I guess. But then,
> you would expect stability/versioning. That's not what I am proposing (at
> least at this point), which is just about the build system and project
> structure, so we can build and work on subprojects independently. (for ex,
> in my wip branch, qemu-ga meson.build is 115 lines, doesn't need QEMU
> configure etc)

I'm afraid I'm still wobbly on the benefits of subprojects, or even how
to work with them.

How exactly would we "build and work independently" on the subprojects
involving QAPI?  git-clone all of QEMU, but build only a subproject (and
its dependencies)?  Am I confused?

>> > We don't neccessarily need the current QAPI C code generator. There
>> > could be a new C generator that didn't use qobject, but instead used
>> > some standard GLib types like GHashTable/GList instead of QDict/QList.
>>
>> Yes, that should be possible.
>>
>>
> I can't see much benefit from doing that extra work. It would create two C
> APIs, making future bindings efforts more difficult etc.

We need to distinguish client-side and server-side APIs / bindings.

The existing C generator targets internal, server-side use.  It
generates everything defined in the schema.

The existing introspection generator generates data for external,
client-side use (via QMP).  It generates just the subset visible in QMP.

The proposed Go generator also targets external, client-side use (client
bindings for QMP), and should also generate just the subset visible in
QMP.

So should a future C generator of client bindings for QMP.

And then we'd have two distinct C APIs: a server-side one to help us
implement QMP, and a client-side one to help use use QMP (QMP bindings).

Whether the two would profit from sharing QObject is not clear to me
at this point.

> QObject is very much like GValue though (the naming is better too :), just
> like the QOM & GObject story.
>
> thanks



  reply	other threads:[~2022-09-02 11:25 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  9:35 [PATCH v2 00/15] Preliminary patches for subproject split marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 01/15] error-report: misc comment fix marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 02/15] error-report: introduce "detailed" variable marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 03/15] error-report: simplify print_loc() marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 04/15] error-report: introduce overridable error_is_detailed() marcandre.lureau
2022-07-12 15:02   ` Warner Losh
2022-07-19  7:24   ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 05/15] stubs: remove needless error_vprintf_unless_qmp() marcandre.lureau
2022-07-19  7:24   ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 06/15] qapi: move QEMU-specific dispatch code in monitor marcandre.lureau
2022-08-02 10:58   ` Markus Armbruster
2022-08-02 11:19     ` Marc-André Lureau
2022-08-02 12:21       ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 07/15] scripts/qapi-gen: add -i option marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 08/15] scripts/qapi: add required system includes to visitor marcandre.lureau
2022-07-12 15:08   ` Warner Losh
2022-07-12  9:35 ` [PATCH v2 09/15] util: move 256-by-128 division helpers to int128 marcandre.lureau
2022-08-04 16:17   ` Marc-André Lureau
2022-08-04 17:04   ` Lucas Mateus Martins Araujo e Castro
2022-07-12  9:35 ` [PATCH v2 10/15] qemu-common: introduce a common subproject marcandre.lureau
2022-07-12 14:57   ` Warner Losh
2022-07-15 11:55     ` Marc-André Lureau
2022-07-12  9:35 ` [PATCH v2 11/15] qemu-common: move scripts/qapi marcandre.lureau
2022-08-05  8:02   ` Markus Armbruster
2022-08-05  8:49     ` Marc-André Lureau
2022-08-11  6:52       ` Markus Armbruster
2022-08-11  7:11         ` Marc-André Lureau
2022-08-11  9:05           ` Markus Armbruster
2022-08-11 10:09             ` Marc-André Lureau
2022-08-11 10:22               ` Peter Maydell
2022-08-11 10:50                 ` Marc-André Lureau
2022-08-11 12:15                   ` Daniel P. Berrangé
2022-08-11 13:35                     ` Markus Armbruster
2022-08-22  8:16                       ` Marc-André Lureau
2022-09-02 11:15                         ` Markus Armbruster [this message]
2022-09-02 13:22                           ` Marc-André Lureau
2022-08-11 11:46                 ` Markus Armbruster
2022-07-12  9:35 ` [PATCH v2 12/15] qemu-common: move glib-compat.h marcandre.lureau
2022-07-12 15:00   ` Warner Losh
2022-07-12  9:35 ` [PATCH v2 13/15] qemu-common: move error-report marcandre.lureau
2022-07-12  9:35 ` [PATCH v2 14/15] mtest2make.py: teach suite name that are just "PROJECT" marcandre.lureau
2022-08-05 10:35   ` Paolo Bonzini
2022-08-05 11:22     ` Marc-André Lureau
2022-07-12  9:35 ` [PATCH v2 15/15] qemu-common: add error-report test marcandre.lureau

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=87o7vyt4b4.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=jsnow@redhat.com \
    --cc=kevans@freebsd.org \
    --cc=kwolf@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@yandex-team.ru \
    --cc=xieyongji@bytedance.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.