qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v8 2/3] qom: pass original path to unparent meth


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v8 2/3] qom: pass original path to unparent method
Date: Mon, 18 Mar 2013 16:08:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

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 via email to

[Prev in Thread] Current Thread [Next in Thread]