qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/4] qom: Replace "automatic arrayification"


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 0/4] qom: Replace "automatic arrayification"
Date: Wed, 12 Nov 2014 18:13:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0


On 12/11/2014 18:08, Markus Armbruster wrote:
> "Automatic arrayification" is a convenience feature for creating a
> bunch of properties with a common type, accessors and so forth, named
> in a peculiar way: "foo[0]", "foo[1]", ...  It's implemented by making
> property names ending with "[*]" magical.  The magic is uncalled for,
> as names can be just as well generated separately from adding
> properties.
> 
> See also
> https://lists.nongnu.org/archive/html/qemu-devel/2014-10/msg00623.html

I dislike having the caller free the property name.  It is decent as you
used it here, but it won't be usable if we later try and avoid making
all memory region names array-ified.

I like the idea, but the API is just too ugly. :(  Unfortunately I have
nothing better to propose.

Paolo

> Markus Armbruster (4):
>   qom: New object_gen_new_property_name()
>   memory: Use object_gen_new_property_name() instead of "arrayification"
>   qdev: Use object_gen_new_property_name() instead of "arrayification"
>   Revert "qom: Add automatic arrayification to object_property_add()"
> 
>  hw/core/qdev.c       | 18 ++++++++++++------
>  include/qom/object.h |  8 ++++++++
>  memory.c             |  6 +++---
>  qom/object.c         | 35 ++++++++++++++---------------------
>  4 files changed, 37 insertions(+), 30 deletions(-)
> 



reply via email to

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