Assuiming you have a disk image with Fedora called: "base.qcow2", launch QEMU this way: $ qemu-system-x86_64 -display none -no-user-config \ -nodefaults -monitor stdio -cpu IvyBridge \ -machine pc,accel=kvm,usb=off -m 2048 -blockdev node-name=node-Base,driver=qcow2,file.driver=file,file.filename=./base.qcow2 \ -device virtio-blk,drive=node-Base,id=virtio0 \ -qmp unix:/tmp/qmp-sock,server,nowait Then, from 'qemu/scripts/qmp/', invoke the 'qmp-shell' (this is just a convenient script that lets you supply key-value pairs of input and outputs (except when it doesn't) raw JSON): $ ./qmp/qmp-shell -p -v /tmp/qmp-sock (QEMU) A simple example, when you type the QMP command `query-kvm` on the 'qmp-shell', you'll see it generate JSON query with arguments (there are none in this case) and its succesful response: (QEMU) query-kvm { "execute": "query-kvm", "arguments": {} } { "return": { "enabled": true, "present": true } } The Problem ----------- Now, let's try a bit more complex command that I'm hoping the 'qmp-shell' will generate valid JSON. But it doesn't: (QEMU) query-cpu-model-expansion type=static model={"name":"IvyBridge"} { "execute": "query-cpu-model-expansion", "arguments": { "model": "{name:IvyBridge}", "type": "static" } } { "error": { "class": "GenericError", "desc": "Invalid parameter type for 'model', expected: object" } } (QEMU) *Ideally*, it should generate the following: { "execute":"query-cpu-model-expansion", "arguments":{ "type":"static", "model":{ "name":"IvyBridge" } } } - - - Looking at the code of the 'qmp-shell', its very rudimentary parser __parse_value(): https://git.qemu.org/?p=qemu.git;a=blob;f=scripts/qmp/qmp-shell;h=770140772d07b90d8a03d54a6d570d269002cb07;hb=HEAD#l167