Regression: Nested JSON structs in 'qmp-shell'
Hi,
Just noticed that this commit fcfab7541 ("qmp-shell: learn to send commands with quoted arguments"), which introduces the usage of Python 'shlex' to handle quoted arguments, but it accidentally broke generation of nested JSON structs.
With commit fcfab7541, you'll see the following brokenness:
(QEMU) blockdev-create job-id=job0 options={"driver":"qcow2","size":16384,"file":{"driver":"file","filename":"foo.qcow2"}}
{
"execute": "blockdev-create",
"arguments": {
"job-id": "job0",
"options": "{driver:qcow2,size:16384,file:{driver:file,filename:foo.qcow2}}"
}
}
{
"error": {
"class": "GenericError",
"desc": "Invalid parameter type for 'options', expected: object"
}
}If I revert commit fcfab7541, then the same 'qmp-shell' invocation generates the _correct_ nested JSON:
(QEMU) blockdev-create job-id=job0 options={"driver":"qcow2","size":16384,"file":{"driver":"file","filename":"foo.qcow2"}}
{
"execute": "blockdev-create",
"arguments": {
"job-id": "job000000000",
"options": {
"driver": "qcow2",
"file": {
"driver": "file",
"filename": "foo.qcow2"
},
"size": 16384
}
}
}
{
"return": {}
} Signature · 1 line
/kashyap