All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	marcandre.lureau@redhat.com
Subject: Re: [PATCH 0/4] qemu-storage-daemon: QAPIfy --chardev the stupid way
Date: Wed, 28 Oct 2020 12:46:25 +0100	[thread overview]
Message-ID: <20201028114625.GA7355@merkur.fritz.box> (raw)
In-Reply-To: <87a6w63kbw.fsf@dusky.pond.sub.org>

Am 28.10.2020 um 08:01 hat Markus Armbruster geschrieben:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
> > On 26/10/20 11:10, Markus Armbruster wrote:
> >> Kevin's "[PATCH v2 0/6] qemu-storage-daemon: QAPIfy --chardev"
> >> involves surgery to the QAPI generator.  Some (most?) of it should go
> >> away if we deprecate the "data" wrappers due to simple unions in QMP.
> >> 
> >> Do we really need to mess with the code generator to solve the problem
> >> at hand?
> >> 
> >> 
> >> Let's recapitulate the problem:
> >> 
> >> * We want to QAPIfy --chardev, i.e. define its argument as a QAPI
> >>   type.
> >
> > Considering that this is not 5.2 stuff at this point, I would like to
> > suggest again moving chardevs to -object, and ask you to evaluate that
> > option with the agreement that I do the work instead of you. :)

I don't think this is the right thing to do at this point. Making more
use of QOM is an orthogonal problem and would only make solving this one
harder.

The problem we have and we're trying to solve is that we have
chardev-add (which has a QAPI schema) and -chardev (which doesn't). We
want to get an option that is described by the schema, doesn't duplicate
things and is still convenient to use.

Whether this option starts with -chardev or with -object doesn't really
make much of a difference. The QAPI schema you need behind it will be
almost or even exactly the same.

> Replacing -chardev with -object without regressing features would be
> lovely.  One feature in particular: introspection.
> 
> If we manage to fully QAPIfy -object, we should be good.  I understand
> Eduardo is cutting a path through the jungle.

I don't expect many difficulties with the existing -object (famous last
words).

But if you make chardevs user creatable objects first, it becomes much
harder because you just combined two problems (one of which is already
known to be hard) into one large problem.

> I can offer assistance with bridging QAPI schema to QOM.

So, the steps that I would suggest are:

1a. Finish the QAPI schema for object-add

1b. Find some way to unify chardev-add's ChardevBackend and a
    CLI-friendly version of it in the schema

2. Generate QOM boilerplate code from ObjectOptions instead of
   duplicating it in the implementation

3. Convert chardevs to using QOM properites only now

If we do 3. earlier, we'll write code that we want to replace later
anyway. If we even do it in parallel with 1b. we'll additionally get
merge conflicts. And if we do it before 1b. we'll do it without
considering QAPI in detail and will lose any flexibility to change
things in the new interface, which will make 1b. much harder.

Kevin



  reply	other threads:[~2020-10-28 11:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 10:10 [PATCH 0/4] qemu-storage-daemon: QAPIfy --chardev the stupid way Markus Armbruster
2020-10-26 10:10 ` [PATCH 1/4] char/stdio: Fix QMP default for 'signal' Markus Armbruster
2020-10-26 10:10 ` [PATCH 2/4] char: Factor out qemu_chr_print_types() Markus Armbruster
2020-10-26 10:10 ` [PATCH 3/4] char: Flat alternative to overly nested chardev-add arguments Markus Armbruster
2020-10-27 18:23   ` Eric Blake
2020-10-28  7:33     ` Markus Armbruster
2020-10-26 10:10 ` [PATCH 4/4] qemu-storage-daemon: QAPIfy --chardev Markus Armbruster
2020-10-27 18:59   ` Eric Blake
2020-10-28  7:42     ` Markus Armbruster
2020-10-28  9:18   ` Markus Armbruster
2020-10-27 18:36 ` [PATCH 0/4] qemu-storage-daemon: QAPIfy --chardev the stupid way Paolo Bonzini
2020-10-28  7:01   ` Markus Armbruster
2020-10-28 11:46     ` Kevin Wolf [this message]
2020-10-28 14:39       ` Paolo Bonzini
2020-10-28 14:59         ` Kevin Wolf
2020-10-28 15:09           ` Paolo Bonzini
2020-10-28 15:39             ` Kevin Wolf
2020-10-28 16:01               ` Paolo Bonzini

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=20201028114625.GA7355@merkur.fritz.box \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.