All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org, "Pratik Parvati" <pratikp@vayavyalabs.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: sysbus_create_simple Vs qdev_create
Date: Mon, 20 Jul 2020 11:59:55 -0400	[thread overview]
Message-ID: <20200720155955.GV1274972@habkost.net> (raw)
In-Reply-To: <87r1t6hc0f.fsf@dusky.pond.sub.org>

On Mon, Jul 20, 2020 at 09:38:24AM +0200, Markus Armbruster wrote:
> Eduardo Habkost <ehabkost@redhat.com> writes:
> 
> > On Fri, Jul 17, 2020 at 07:10:57AM +0200, Markus Armbruster wrote:
> >> Eduardo Habkost <ehabkost@redhat.com> writes:
> >> 
> >> > I'd also note that the use of "parent" in the code is also
> >> > ambiguous.  It can mean:
> >> >
> >> > * QOM parent type, i.e. TypeInfo.parent.  Related fields:
> >> >   * parent_class members of class structs
> >> >   * parent_obj members of object structs
> >> 
> >> I hate the use of "parent" and "child" for a super- / subtype relation.
> >> 
> >> Correcting the terminology there would be short term pain for long term
> >> gain.  Worthwhile?
> >
> > I don't know.  It looks like the terminology came from GObject.
> >
> >> 
> >> > * QOM composition tree parent object, i.e. Object::parent
> >> > * qdev device parent bus, i.e. DeviceState::parent_bus
> >> > * parent device of of qdev bus, i.e. BusState::parent
> >> 
> >> These are tree relations.  Use of "parent" and "child" is perfectly
> >> fine.
> >
> > The terms are fine but still ambiguous, as devices belong to two
> > separate trees at the same time (the QOM composition tree, and
> > the qdev tree).
> >
> > I never understood why we have two separate independent object
> > trees.
> 
> When we rebased qdev onto QOM, we left the qdev tree alone, we did not
> embed it into the QOM composition tree.
> 
> The qdev tree edge from bus to device providing the bus is commonly
> mirrored in the QOM composition tree: both are QOM objects, and the bus
> is commonly a QOM composition child of the device providing it.  I hedge
> with "commonly", because nothing enforces this as far as I know.
> 
> We do not mirror the edge from device to the bus it's plugged into.  I
> believe we could have.  I guess we could mirror it as a link even now
> (but note links are not children).

They are already mirrored as links, and guess what's the link
name: "child[...]".

> 
> I don't know why the rebase of qdev onto QOM was done that way.  Perhaps
> Paolo remembers.

I'm guessing this is because QOM parent/child relationships
represent ownership, while there's no ownership relationship
between buses and devices.

-- 
Eduardo



  reply	other threads:[~2020-07-20 16:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 16:09 sysbus_create_simple Vs qdev_create Pratik Parvati
2020-07-14 16:17 ` Pratik Parvati
2020-07-14 17:02   ` Philippe Mathieu-Daudé
2020-07-15  8:32     ` Markus Armbruster
2020-07-15 13:58       ` Pratik Parvati
2020-07-15 14:11         ` Peter Maydell
2020-07-15 14:37         ` Markus Armbruster
2020-07-16 22:21           ` Eduardo Habkost
2020-07-17  5:10             ` Markus Armbruster
2020-07-17 16:23               ` Eduardo Habkost
2020-07-17 16:30                 ` Daniel P. Berrangé
2020-07-17 17:15                   ` Peter Maydell
2020-07-20  7:39                     ` Markus Armbruster
2020-07-20  7:38                 ` Markus Armbruster
2020-07-20 15:59                   ` Eduardo Habkost [this message]
2020-07-21  6:00                     ` Markus Armbruster
2020-07-27 14:29                       ` Paolo Bonzini
2020-07-28  7:19                         ` Markus Armbruster
2020-07-28 17:38                           ` Paolo Bonzini
2020-07-28 22:47                             ` Eduardo Habkost
2020-07-29  9:54                               ` Paolo Bonzini
2020-07-29 13:18                                 ` Markus Armbruster
2020-07-29 16:08                                   ` Paolo Bonzini
2020-07-30 10:03                                     ` Markus Armbruster
2020-07-30 11:09                                       ` Paolo Bonzini
2020-07-30 12:36                                         ` Markus Armbruster
2020-07-30 13:38                                           ` Paolo Bonzini
2020-07-29 14:32                                 ` Eduardo Habkost
2020-07-29 16:01                                   ` Paolo Bonzini
2020-07-29 16:08                                     ` Eduardo Habkost
2020-07-29 16:14                                       ` Paolo Bonzini
2020-07-29  7:46                             ` 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=20200720155955.GV1274972@habkost.net \
    --to=ehabkost@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=pratikp@vayavyalabs.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.