qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] Revert "qom: Add automatic arrayification t


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 4/4] Revert "qom: Add automatic arrayification to object_property_add()"
Date: Thu, 13 Nov 2014 10:50:14 +0000

On 13 November 2014 10:05, Paolo Bonzini <address@hidden> wrote:
>
>
> On 12/11/2014 23:47, Peter Maydell wrote:
>> On 12 November 2014 22:25, Paolo Bonzini <address@hidden> 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

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