qom: Add automatic arrayification to object_property_add()
commit339659041f87a76f8b71ad3d12cadfc5f89b4bb3
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Wed, 20 Aug 2014 06:55:52 +0000 (19 23:55 -0700)
committerAndreas Färber <afaerber@suse.de>
Thu, 4 Sep 2014 14:14:47 +0000 (4 16:14 +0200)
treedfd65efd31731e7a127928d756dc09dfb9ae48f8
parentd2659e27e1ec0b5126faa0f4fef78755950b39e6
qom: Add automatic arrayification to object_property_add()

If "[*]" is given as the last part of a QOM property name, treat that
as an array property. The added property is given the first available
name, replacing the * with a decimal number counting from 0.

First add with name "foo[*]" will be "foo[0]". Second "foo[1]" and so
on.

Callers may inspect the ObjectProperty * return value to see what
number the added property was given.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
qom/object.c