All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "P. Berrange, Daniel" <berrange@redhat.com>,
	Sergio Lopez Pascual <slp@redhat.com>,
	"Hajnoczi, Stefan" <stefanha@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Bonzini, Paolo" <pbonzini@redhat.com>,
	John Snow <jsnow@redhat.com>
Subject: Re: [PATCH] PoC: Rust binding for QAPI (qemu-ga only, for now)
Date: Tue, 22 Sep 2020 20:25:06 +0400	[thread overview]
Message-ID: <CAJ+F1CLjZ5EA+R+Bo9WGTwJ1ju3tCXWbquP5gkQwRA4fL6V9Kw@mail.gmail.com> (raw)
In-Reply-To: <87y2l1kel8.fsf@dusky.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 3733 bytes --]

Hi

On Tue, Sep 22, 2020 at 7:39 PM Markus Armbruster <armbru@redhat.com> wrote:

> Marc-André Lureau <marcandre.lureau@redhat.com> writes:
>
> > Hi
> >
> > On Mon, Sep 21, 2020 at 1:16 PM Markus Armbruster <armbru@redhat.com>
> wrote:
> >>
> >> marcandre.lureau@redhat.com writes:
> [...]
> >> > Finally, given that the QAPI types are easy to serialize, it was
> simple
> >> > to use "serde" on them, and provide a D-Bus interface for QMP with
> zbus.
> >> > (a similar approach could probably be taken for other protocols, that
> >> > could be dynamically loaded... anyone like protobuf better?)
> >>
> >> QMP is an *external* interface.
> >>
> >> It supports compatible evolution: we can make certain kinds of changes
> >> without affecting clients.  These include:
> >>
> >> * Adding optional arguments
> >>
> >> * Adding results
> >>
> >> * Adding values to an enumeration type, branches to a union or
> >>   alternate
> >>
> >> * Reordering members of enumerations, structs, unions
> >>
> >> * Turning an argument type into an alternate with the old type as branch
> >>
> >> We've made use of this extensively.  See also
> >> docs/devel/qapi-code-gen.txt section "Compatibility considerations."
> >>
> >> How do such changes affect clients of the proposed D-Bus interface?
> >>
> >
> > It's not just about the D-Bus interface though.
> >
> > QMP being JSON, being lazily typed: everytime we make such changes, we
> > inflict some pain to all the QMP bindings that want to have a
> > statically checked & native version of the interface. Iow, we should
> > think twice before doing any of this.
>
> Having to think twice before doing something we need to do all the time
> would slow us down.  I don't think this is going to fly.
>
> QMP is designed to avoid tight coupling of server (i.e. QEMU) and
> client.  In particular, we don't want "you have to upgrade both in
> lockstep".
>
> A well-behaved client works fine even when it's written for a somewhat
> older or newer QMP than the server provides.  "Somewhat" because we
> deprecate and eventually remove stuff.  Graceful degradation when the
> gap gets too large.
>
> There's a gap between the "lose" wire format, and a "tight" statically
> typed internal interface.  The gap exists in QEMU, and we bridge it.
> Clients can do the same.  Libvirt does: it provides a statically typed
> version of the interface without undue coupling.
>
> Replacing the "lose" wire format by something "tighter" like D-Bus
> shrinks the gap.  Good.  It also tightens the coupling.  Bad.
>
> [...]
>
>
>

At least, this little D-Bus experiment puts some light on one of the
current QMP weakness: it's hard to bind QMP.

There are good reasons to prefer strongly typed languages. Whenever QMP is
statically bound there, and such changes are made, it is pushing the
versionning issues to others. It's probably one of the reasons why people
are stuck binding QMP manually: doing it automatically would not be
practical, as it would regularly break the interface & build. You have to
version the schema & interface yourself.

So we end up with multiple bindings, manually bound with mistakes etc.

What does this freedom really gives us in exchange? We don't want to commit
to a stable API? It's not rocket science, everybody else does it with
interface version numbers. What makes QEMU/QMP so different?

As for this D-Bus binding, if we don't commit to some better QMP stability
guarantees, we could simply bump the version of the D-Bus interfaces for
each Qemu release (without compatibility with older versions). It's not a
great idea, but it's the best to do then.


-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 4829 bytes --]

  reply	other threads:[~2020-09-22 16:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10 17:48 [PATCH] PoC: Rust binding for QAPI (qemu-ga only, for now) marcandre.lureau
2020-09-11 10:24 ` Paolo Bonzini
2020-09-11 13:08   ` Paolo Bonzini
2020-09-11 14:00     ` Marc-André Lureau
2020-09-11 15:17       ` Paolo Bonzini
2020-09-29 17:55         ` Marc-André Lureau
2020-09-29 18:23           ` Paolo Bonzini
2020-09-30  9:15             ` Marc-André Lureau
2020-09-30 14:02               ` Paolo Bonzini
2020-09-11 10:46 ` Daniel P. Berrangé
2020-09-11 11:03   ` Marc-André Lureau
2020-09-11 11:28   ` Paolo Bonzini
2020-09-11 11:31     ` Daniel P. Berrangé
2020-09-11 14:19     ` John Snow
2020-09-11 14:17 ` Marc-André Lureau
2020-09-21  9:16 ` Markus Armbruster
2020-09-21  9:30   ` Paolo Bonzini
2020-09-22 14:59     ` Markus Armbruster
2020-09-21 10:04   ` Marc-André Lureau
2020-09-22 15:09     ` Markus Armbruster
2020-09-22 16:35       ` Marc-André Lureau
2020-09-22 17:08         ` Paolo Bonzini
2020-09-29  7:45           ` Marc-André Lureau
2020-09-29 10:14             ` Paolo Bonzini
2020-09-29 10:34               ` Marc-André Lureau
2020-09-29 11:00                 ` Paolo Bonzini
2020-09-29 11:34                   ` Marc-André Lureau
2020-09-30  7:34                     ` Markus Armbruster
2020-09-30  7:51                       ` Marc-André Lureau
2020-09-30 13:14                         ` Paolo Bonzini
2020-09-22 16:52       ` Daniel P. Berrangé
2020-09-23 11:51         ` Markus Armbruster
2020-09-21 10:11   ` Marc-André Lureau
2020-09-22 15:37     ` Markus Armbruster
2020-09-22 16:25       ` Marc-André Lureau [this message]
2020-09-24  7:31         ` Markus Armbruster

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=CAJ+F1CLjZ5EA+R+Bo9WGTwJ1ju3tCXWbquP5gkQwRA4fL6V9Kw@mail.gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=slp@redhat.com \
    --cc=stefanha@gmail.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.