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

2014-11-14 Thread Markus Armbruster
Paolo Bonzini writes: > On 14/11/2014 15:21, Markus Armbruster wrote: >> qdev properties can easily use object_gen_new_property_name() instead, >> as shown in PATCH 3/4. >> >> So can memory regions [PATCH 2/4], but only because we clumsily arrayify >> all of them, by appending "[*]" in memory_re

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

2014-11-14 Thread Paolo Bonzini
On 14/11/2014 15:21, Markus Armbruster wrote: > qdev properties can easily use object_gen_new_property_name() instead, > as shown in PATCH 3/4. > > So can memory regions [PATCH 2/4], but only because we clumsily arrayify > all of them, by appending "[*]" in memory_region_init(). > > Some day, w

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

2014-11-14 Thread Markus Armbruster
Paolo Bonzini writes: > On 13/11/2014 15:34, Markus Armbruster wrote: >> -... "bla" ... >> +char *name = object_gen_new_property_name(obj, "bla"); >> +... name ... >> +g_free(name); >> >> Not quite as mechanical, in particular finding the obj to pass to >> object_gen_new_property

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

2014-11-13 Thread Paolo Bonzini
On 13/11/2014 15:34, Markus Armbruster wrote: > -... "bla" ... > +char *name = object_gen_new_property_name(obj, "bla"); > +... name ... > +g_free(name); > > Not quite as mechanical, in particular finding the obj to pass to > object_gen_new_property_name(). > > Correct? Yes (ex

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

2014-11-13 Thread Markus Armbruster
Paolo Bonzini writes: > On 13/11/2014 09:08, Markus Armbruster wrote: >>> > >>> > I like the idea, but the API is just too ugly. :( Unfortunately I have >>> > nothing better to propose. >> For what it's worth, three out of four uses already need to free, >> because they append "[*]" to an argume

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

2014-11-13 Thread Paolo Bonzini
On 13/11/2014 09:08, Markus Armbruster wrote: >> > >> > I like the idea, but the API is just too ugly. :( Unfortunately I have >> > nothing better to propose. > For what it's worth, three out of four uses already need to free, > because they append "[*]" to an argument string. Yes, your API wor

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

2014-11-13 Thread Markus Armbruster
Paolo Bonzini writes: > 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 >> propert

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

2014-11-12 Thread Paolo Bonzini
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 "[*]" ma

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

2014-11-12 Thread Markus Armbruster
"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