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 works well for the cases it's replacing now.

> Can you explain what you mean by "avoid making all memory region names
> array-ified", and why my API won't be usable for that?

Basically removing the "[*]" from memory_region_init, and instead adding
it to all callers.  It can then be removed from those callers that do
not need array-ification, which is most of them.

But you would still need it in most non-qdevified devices.  In that
case, the parent of the MemoryRegions is just /machine; hence, just
having two serial ports gives you two same-named memory regions.  So
non-qdevified devices would require surgery to add
object_gen_new_property_name, and they exactly those that one doesn't
want to touch. :)

If everything were qdevified, I agree that object_gen_new_property_name
would be a fine API.

Paolo

Reply via email to