qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Anthony Liguori" <aliguori@us.ibm.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	libvir-list@redhat.com, "Stefan Hajnoczi" <stefanha@gmail.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
	"Luiz Capitulino" <lcapitulino@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH v8 2/3] qom: pass original path to unparent method
Date: Mon, 18 Mar 2013 16:08:02 +0100	[thread overview]
Message-ID: <51472DD2.20202@redhat.com> (raw)
In-Reply-To: <20130318143551.GA13513@redhat.com>

Il 18/03/2013 15:35, Michael S. Tsirkin ha scritto:
> > There's no harm AFAICT in doing this and it seems more logical to me to
> > have destruction flow start with the subclass and move up to the base
> > class.
> 
> At Paolo's request children are intentionally reported before parents,
> shouldn't this apply?

That's ok.  Because children are reported first, the parent's path will
still be in place while the children are being unparented.

Subclasses and the composition tree form two different dimensions, but
in both cases the idea is to unparent bottom-up:

1) subclasses dictate the order in which to unparent a single object.
The subclasses should be "disconnected" first, before moving up towards
Object whose unparenting is done by object_parent_del_child.  This way,
when a subclass's unparent runs the superclass's bits are still in a
good state.

2) the composition tree dictates the order in which to unparent multiple
objects.  Here children should be unparented first.  This way, when a
child's unparent runs the parent is still in a good state.

Paolo

  reply	other threads:[~2013-03-18 15:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 12:40 [Qemu-devel] [PATCH v8 0/3] DEVICE_DELETED event Michael S. Tsirkin
2013-03-14 12:40 ` [Qemu-devel] [PATCH v8 1/3] qdev: " Michael S. Tsirkin
2013-03-14 12:40 ` [Qemu-devel] [PATCH v8 2/3] qom: pass original path to unparent method Michael S. Tsirkin
2013-03-18 14:24   ` Anthony Liguori
2013-03-18 14:35     ` Michael S. Tsirkin
2013-03-18 15:08       ` Paolo Bonzini [this message]
2013-03-18 15:03     ` Paolo Bonzini
2013-03-18 16:04       ` Anthony Liguori
2013-03-14 12:40 ` [Qemu-devel] [PATCH v8 3/3] qmp: add path to device_deleted event Michael S. Tsirkin
2013-03-14 14:18 ` [Qemu-devel] [PATCH v8 0/3] DEVICE_DELETED event Markus Armbruster
2013-03-14 22:56 ` [Qemu-devel] [libvirt] " Eric Blake

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=51472DD2.20202@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).