qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 09/13] memory: MemoryRegion: QOMify


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH 09/13] memory: MemoryRegion: QOMify
Date: Wed, 11 Jun 2014 16:15:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

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.

Paolo



reply via email to

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