qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Regression: Nested JSON structs in 'qmp-shell'
@ 2019-02-04 14:11 Kashyap Chamarthy
  0 siblings, 0 replies; only message in thread
From: Kashyap Chamarthy @ 2019-02-04 14:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: jsnow, marcandre.lureau, armbru

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": {}                                                                                                                                                                              
    }                      


-- 
/kashyap

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-04 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 14:11 [Qemu-devel] Regression: Nested JSON structs in 'qmp-shell' Kashyap Chamarthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).