On 13 November 2014 10:05, Paolo Bonzini <pbonz...@redhat.com> wrote:
>
>
> On 12/11/2014 23:47, Peter Maydell wrote:
>> On 12 November 2014 22:25, Paolo Bonzini <pbonz...@redhat.com> wrote:
>> > The plan was to move [*] down into the devices.  Devices that do not
>> > need to arrayify properties (e.g. most qdev-ified devices) can then skip
>> > the [*] and have nicer names.
>>
>> Qdev devices have array properties already via a different
>> mechanism, right? (Did we have a plan to unify them somehow?)
>
> I've never looked into qdev array properties that much, actually.

qdev array properties work by:
 * user of the device sets the "len-myarray" property to n
 * this automatically causes the creation of properties
   "myarray[0]" through to "myarray[n-1]" and allocation of
   some memory to contain their values
 * user of the device can then set those properties on the device

So you can use them to define properties which are
variable-length arrays, rather than having to decide at
build time how long the array could possibly be.

-- PMM

Reply via email to