All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: imammedo@redhat.com, alex.williamson@redhat.com,
	eblake@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH 0/2] qapi/qom: use correct field name when getting/setting alias properties
Date: Wed, 21 Jul 2021 13:50:40 +0200	[thread overview]
Message-ID: <4430dc1a-5938-f0da-dcd5-18f3565a485c@redhat.com> (raw)
In-Reply-To: <87czrddlqe.fsf@dusky.pond.sub.org>

On 20/07/21 17:54, Markus Armbruster wrote:
> First, let me describe what's wrong in my own words, because that's how
> I understand stuff.
> 
> [snip]

All correct.

> Next, the solution.  I get the idea of a wrapper visitor which gives you
> "pflash0" when you ask for "drive", but oh boy do I wish we could fix
> the bug with a lot less code.

Yeah, if QOM didn't use visitors and just went with QObject as the 
argument to getters/setters, all this wouldn't be needed.

That said, 1/3rd of this patch is tests, and visitors do have a hidden 
advantage: they give type checking for free.  So all in all I'm not sure 
it would be better, especially now that we're starting to get more 
benefit from them (e.g. with compound properties replacing 
special-purpose command line parsing code).

Paolo



  reply	other threads:[~2021-07-21 11:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 10:40 [PATCH 0/2] qapi/qom: use correct field name when getting/setting alias properties Paolo Bonzini
2021-07-19 10:40 ` [PATCH 1/2] qapi: introduce forwarding visitor Paolo Bonzini
2021-07-20  0:54   ` Eric Blake
2021-07-22 14:02   ` Markus Armbruster
2021-07-22 15:08     ` Paolo Bonzini
2021-07-22 15:34       ` Markus Armbruster
2021-07-23  9:49         ` Paolo Bonzini
2021-07-19 10:40 ` [PATCH 2/2] qom: use correct field name when getting/setting alias properties Paolo Bonzini
2021-07-19 11:51   ` Philippe Mathieu-Daudé
2021-07-20  1:00   ` Eric Blake
2021-07-21  9:51     ` Paolo Bonzini
2021-07-21 14:43       ` Markus Armbruster
2021-07-20 15:54 ` [PATCH 0/2] qapi/qom: " Markus Armbruster
2021-07-21 11:50   ` Paolo Bonzini [this message]
2021-07-22 13:25 ` Markus Armbruster
2021-07-22 13:36   ` 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=4430dc1a-5938-f0da-dcd5-18f3565a485c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=imammedo@redhat.com \
    --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.