Start QEMU with QMP UNIX socket and connect:
./qemu-system-x86_64.exe -qmp unix:test.socket,server,nowait ...
nc -U test.socket
qmp-shell test.socket # see https://github.com/0xef53/qmp-shellOr start QEMU with QMP TCP socket and connect:
./qemu-system-x86_64.exe -qmp tcp:127.0.0.1:12345,server,nowait ...
nc localhost 12345After you open the socket, the first command is always:
{ "execute": "qmp_capabilities" }Then you can either execute human or machine friendly commands.
{ "execute": "human-monitor-command", "arguments": { "command-line": "help" } }{ "execute": "query-qmp-schema" }
{ "execute": "query-machines" }
{ "execute": "query-pci" }
{ "execute": "device-list-properties", "arguments": { "typename": "vmxnet3" } }
{ "execute": "qom-list", "arguments": { "path": "/" } }
{ "execute": "qom-list", "arguments": { "path": "/machine" } }
{ "execute": "qom-get", "arguments": { "path": "/machine", "property": "type" } }
{ "execute": "qom-list", "arguments": { "path": "/machine/i440fx" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/i440fx", "property": "type" } }
{ "execute": "qom-list", "arguments": { "path": "/machine/i440fx/pci.0" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/i440fx/pci.0", "property": "type" } }
{ "execute": "qom-list", "arguments": { "path": "/machine/i440fx/pci.0/child[3]" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/i440fx/pci.0/child[3]", "property": "type" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/i440fx/pci.0/child[3]", "property": "mac" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/i440fx/pci.0/child[3]", "property": "netdev" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/i440fx/pci.0/child[3]", "property": "legacy-addr" } }
{ "execute": "qom-list", "arguments": { "path": "/machine/peripheral-anon" } }
{ "execute": "qom-list", "arguments": { "path": "/machine/peripheral-anon/device[0]" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/peripheral-anon/device[0]", "property": "type" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/peripheral-anon/device[0]", "property": "mac" } }
{ "execute": "qom-get", "arguments": { "path": "/machine/peripheral-anon/device[0]", "property": "netdev" } }