[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v13 6/6] qom: support arbitrary non-scalar prope
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v13 6/6] qom: support arbitrary non-scalar properties with -object |
Date: |
Mon, 19 Sep 2016 14:19:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 19/09/2016 14:12, Daniel P. Berrange wrote:
> On Mon, Sep 19, 2016 at 12:58:30PM +0100, Daniel P. Berrange wrote:
>> The current -object command line syntax only allows for
>> creation of objects with scalar properties, or a list
>> with a fixed scalar element type. Objects which have
>> properties that are represented as structs in the QAPI
>> schema cannot be created using -object.
>>
>> This is a design limitation of the way the OptsVisitor
>> is written. It simply iterates over the QemuOpts values
>> as a flat list. The support for lists is enabled by
>> allowing the same key to be repeated in the opts string.
>>
>> It is not practical to extend the OptsVisitor to support
>> more complex data structures while also maintaining
>> the existing list handling behaviour that is relied upon
>> by other areas of QEMU.
>>
>> Fortunately there is no existing object that implements
>> the UserCreatable interface that relies on the list
>> handling behaviour, so it is possible to swap out the
>> OptsVisitor for a different visitor implementation, so
>> -object supports non-scalar properties, thus leaving
>> other users of OptsVisitor unaffected.
>
> Urgh, I've just discovered that this is not in fact true.
>
> The 'memory-backend' object type uses uint16List which
> has the hacky list syntax
>
> -object memory-backend-ram,\
> id=ram-node2,size=24578621440,policy=bind,\
> host-nodes=1-2,host-nodes=5,host-nodes=7,
>
> So I'll need to figure out a way to preserve this syntax...
Is there a usecase for qdict_crumple without the following
de-stringification pass? If not, qdict_crumple could use a
StringInputVisitor on the values directly.
Paolo
- [Qemu-devel] [PATCH v13 0/6] QAPI/QOM work for non-scalar object properties, Daniel P. Berrange, 2016/09/19
- [Qemu-devel] [PATCH v13 2/6] option: make parse_option_bool/number non-static, Daniel P. Berrange, 2016/09/19
- [Qemu-devel] [PATCH v13 1/6] qdict: implement a qdict_crumple method for un-flattening a dict, Daniel P. Berrange, 2016/09/19
- [Qemu-devel] [PATCH v13 3/6] qapi: rename QmpInputVisitor to QObjectInputVisitor, Daniel P. Berrange, 2016/09/19
- [Qemu-devel] [PATCH v13 5/6] qapi: add a QObjectInputVisitor that does string conversion, Daniel P. Berrange, 2016/09/19
- [Qemu-devel] [PATCH v13 4/6] qapi: rename QmpOutputVisitor to QObjectOutputVisitor, Daniel P. Berrange, 2016/09/19
- [Qemu-devel] [PATCH v13 6/6] qom: support arbitrary non-scalar properties with -object, Daniel P. Berrange, 2016/09/19
- Re: [Qemu-devel] [PATCH v13 6/6] qom: support arbitrary non-scalar properties with -object, Kevin Wolf, 2016/09/23
- Re: [Qemu-devel] [PATCH v13 6/6] qom: support arbitrary non-scalar properties with -object, Daniel P. Berrange, 2016/09/23
- Re: [Qemu-devel] [PATCH v13 6/6] qom: support arbitrary non-scalar properties with -object, Kevin Wolf, 2016/09/23