On 02/22/2012 09:53 AM, Anthony Liguori wrote:
On 02/20/2012 11:31 AM, Jeff Cody wrote:
The QAPI scripts allow for generating commands that receive parameter
input consisting of a list of custom structs, but the QMP input paramter
checking did not support receiving a qlist as opposed to a qdict for
input.
What are you trying to send on the wire? Something like
{"execute": "foo", "arguments": [ "a", "b", "c" ]}
?
That's not valid per the QMP protocol. "arguments" must always be a QMP
dictionary.
Not a bare list like that (perhaps my wording was poor), but rather an array of
custom structs, that contain QMP dicts. In this particular case:
{"execute": "blockdev-group-snapshot-sync", "arguments": [{ "device":
"ide-hd0","snapshot-file":"/some/place/my-image","format": "qcow2" }]}
When specifying this in the schema JSON file as shown below[1], the QAPI scripts
generate the marshaller& visitor functions that handle everything correctly.
The monitor code, however, could not deal with the QList container for the input
parameters, prior to passing the data to the generated functions.
[1] JSON schema definition:
{ 'type': 'SnapshotDev',
'data': {'device': 'str', 'snapshot-file': 'str', '*format': 'str' } }
{ 'command': 'blockdev-group-snapshot-sync',
'data': { 'dev': [ 'SnapshotDev' ] } }