On Wed, Jun 11, 2014 at 10:19 PM, Paolo Bonzini <[email protected]> wrote: > This series is an approach to MemoryRegion QOMification that is > complementary to Peter's posted patches. Instead of focusing on > properties, it places attention on modeling the lifetime of memory > regions correctly. MemoryRegions are added to the QOM tree as > children of their owner device, and analogously to what was done > for devices, memory_region_destroy becomes a simple forwarder for > object_unparent. Still, I am including Peter's refactorings and > also read-only access to region properties. > > In fact, with this change memory_region_destroy becomes mostly > obsolete, because when the owner dies the children memory regions > will be unparented themselves and then (as they lose the last ref) > finalized. > > In other words, this effectively achieves the same as > http://lists.gnu.org/archive/html/qemu-devel/2013-09/msg00477.html > except it does this by way of removing code rather than adding it! > Indeed I have a follow-up that drops all but 7 calls to > memory_region_destroy. > > I have already applied patches 5 and 6 to the memory branch. > >
This looks good to me, the only change I see worth making pre-merge is moving object_property_add_child_array to the QOM core. All other review discussions have been shelved or closed (as they are additive suggestions mostly). Regards, Peter > Paolo Bonzini (5): > qom: move unparenting to the child property's release callback > qom: delete properties before calling instance_finalize > memory: MemoryRegion: use /machine as default owner > memory: MemoryRegion: rename parent to container > memory: MemoryRegion: replace owner field with QOM parent > > Peter Crosthwaite (8): > qom: object: Ignore refs/unrefs of NULL > qom: object: remove parent pointer when unparenting > memory: MemoryRegion: factor out subregion add functionality > memory: MemoryRegion: factor out memory region re-adder > memory: MemoryRegion: QOMify > memory: MemoryRegion: Add container and addr props > memory: MemoryRegion: Add may-overlap and priority props > memory: MemoryRegion: Add size property > > exec.c | 4 +- > include/exec/memory.h | 29 +++--- > memory.c | 255 > ++++++++++++++++++++++++++++++++++++++++---------- > qom/object.c | 29 +++--- > 4 files changed, 235 insertions(+), 82 deletions(-) > > -- > 1.8.3.1 > >
