qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/5] monitor: add object-add (QMP) and object_ad


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 4/5] monitor: add object-add (QMP) and object_add (HMP) command
Date: Fri, 13 Dec 2013 13:19:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 13/12/2013 03:55, Wenchao Xia ha scritto:
> 于 2013/12/11 2:15, Paolo Bonzini 写道:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Il 10/12/2013 19:00, Eric Blake ha scritto:
>>>>> +  'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
>>>>> +  'gen': 'no' }
>>>
>>> This feels VERY open-coded.  No where else in qapi-schema do we
>>> have 'dict' as a type
>>
>> Yes, in fact the "data" field is entirely skipped by the code
>> generator (that's 'gen':'no').
>>
> 
> Could we use hmp_object_add()->qmp_object_add()->object_add() code path,
> instead of  hmp_object_add()->object_add(),qmp_object_add()->object_add()?
> Would skipping by generator brings some difficult to it?

No, you cannot do that because both hmp_object_add and qmp_object_add
take a QDict.  But hmp_object_add's qdict has strings, while
qmp_object_add has the right types (e.g. integer for integer properties).

It is not entirely clear, but actually the structure is the same as
regular commands that use code generation.

The usual code path is

        hmp_cont          qmp_marshal_input_cont
                \        /
                 qmp_cont

Here it is

  hmp_object_add          qmp_object_add
                \        /
                object_add

So the current structure is fine.

Paolo



reply via email to

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