[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 09/13] memory: MemoryRegion: QOMify
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [RFC PATCH 09/13] memory: MemoryRegion: QOMify |
Date: |
Thu, 12 Jun 2014 00:32:46 +1000 |
On Thu, Jun 12, 2014 at 12:15 AM, Paolo Bonzini <address@hidden> wrote:
> Il 11/06/2014 15:12, Peter Crosthwaite ha scritto:
>
>>> > + if (name) {
>>
>> Should a stock "anonymous" or such name be used if !name?
>>
>>> > + object_property_add_child_array(mr->owner, name, OBJECT(mr));
>
>
> The !name case is used by "transient" memory regions for which we don't want
> the overhead of QOM (right now, this is the subpage memory regions used by
> exec.c). These are removed with object_unref, not object_unparent.
>
> Because of the default owner now being /machine, the problem becomes much
> more pervasive.
>
> I tried a few machines, and even perfectly qdevified ones fail. For example
> ARM has multiple gic_cpu memory regions. And everything that has two
> instances of something that is not qdev-ified will fail horribly (this
> includes PC, whose 8257 DMA controllers are not qdev-ified).
>
> If you do not create all memory region as children you cannot know how to
> destroy the region: will an unref be enough (memory_region_destroy in your
> series) or is unparent also necessary?
>
> In the end, I believe the conceptual cleanliness of destroy==unparent, and
> the removal of 200-odd memory_region_destroy calls, are worth the extra ugly
> [0]'s.
>
I think you get to keep the uniqueness though under my latest
proposal? No tree-wide collision resolution needed. When
object_property_add_child_array sucessfully sets something to [0] (i
== 0 iteration), just create an alias without [] at the same time. The
naming system will behave identically to this patch as-is in all the
collision cases (i >= 1).
Regards,
Peter
> Paolo
>
[Qemu-devel] [RFC PATCH 04/13] qom: delete properties before calling instance_finalize, Paolo Bonzini, 2014/06/11
[Qemu-devel] [RFC PATCH 11/13] memory: MemoryRegion: Add container and addr props, Paolo Bonzini, 2014/06/11
[Qemu-devel] [RFC PATCH 07/13] memory: MemoryRegion: use /machine as default owner, Paolo Bonzini, 2014/06/11
[Qemu-devel] [RFC PATCH 08/13] memory: MemoryRegion: rename parent to container, Paolo Bonzini, 2014/06/11