Last active
September 30, 2025 20:42
-
-
Save rgl/dc38c6875a53469fdebb2e9c0a220c6c to your computer and use it in GitHub Desktop.
Revisions
-
rgl revised this gist
May 17, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,8 @@ Start QEMU with QMP UNIX socket and connect: ```bash qemu-system-x86_64 -qmp unix:test.socket,server,nowait ... nc -U test.socket qmp-shell test.socket # use the raw qmp interface. see https://github.com/0xef53/qmp-shell qmp-shell -H test.socket # use the human interface. see https://github.com/0xef53/qmp-shell ``` Or start QEMU with QMP TCP socket and connect: -
rgl revised this gist
May 17, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,15 +3,15 @@ Start QEMU with QMP UNIX socket and connect: ```bash qemu-system-x86_64 -qmp unix:test.socket,server,nowait ... nc -U test.socket qmp-shell test.socket # see https://github.com/0xef53/qmp-shell ``` Or start QEMU with QMP TCP socket and connect: ```bash qemu-system-x86_64 -qmp tcp:127.0.0.1:12345,server,nowait ... nc localhost 12345 ``` -
rgl revised this gist
May 4, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,8 @@ Then you can either execute human or machine friendly commands. ```json { "execute": "human-monitor-command", "arguments": { "command-line": "help" } } { "execute": "human-monitor-command", "arguments": { "command-line": "info version" } } { "execute": "human-monitor-command", "arguments": { "command-line": "info network" } } { "execute": "human-monitor-command", "arguments": { "command-line": "info qtree" } } ``` -
rgl revised this gist
May 4, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,7 @@ Then you can either execute human or machine friendly commands. ```json { "execute": "human-monitor-command", "arguments": { "command-line": "help" } } { "execute": "human-monitor-command", "arguments": { "command-line": "info qtree" } } ``` ## Machine friendly commands examples -
rgl revised this gist
May 3, 2020 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,6 +38,10 @@ Then you can either execute human or machine friendly commands. { "execute": "query-machines" } { "execute": "query-version" } { "execute": "query-name" } { "execute": "query-status" } { "execute": "query-kvm" } { "execute": "query-pci" } { "execute": "device-list-properties", "arguments": { "typename": "vmxnet3" } } -
rgl revised this gist
May 3, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -62,6 +62,9 @@ Then you can either execute human or machine friendly commands. { "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" } } { "execute": "qom-get", "arguments": { "path": "/machine/peripheral/nic0", "property": "type" } } { "execute": "qom-get", "arguments": { "path": "/machine/peripheral/nic0", "property": "mac" } } ``` # References -
rgl revised this gist
May 3, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,8 @@ Then you can either execute human or machine friendly commands. { "execute": "device-list-properties", "arguments": { "typename": "vmxnet3" } } { "execute": "qom-list-types" } { "execute": "qom-list", "arguments": { "path": "/" } } { "execute": "qom-list", "arguments": { "path": "/machine" } } { "execute": "qom-get", "arguments": { "path": "/machine", "property": "type" } } -
rgl revised this gist
May 3, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ Start QEMU with QMP UNIX socket and connect: ```bash ./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-shell ``` Or start QEMU with QMP TCP socket and connect: @@ -24,8 +25,6 @@ After you open the socket, the first command is always: Then you can either execute human or machine friendly commands. ## Human friendly commands examples ```json -
rgl revised this gist
May 3, 2020 . 1 changed file with 5 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,16 +34,14 @@ Then you can either execute human or machine friendly commands. ## Machine friendly commands examples ```json { "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" } } @@ -63,8 +61,6 @@ Then you can either execute human or machine friendly commands. { "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" } } ``` # References -
rgl revised this gist
May 3, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,9 @@ Then you can either execute human or machine friendly commands. ```json { "execute": "query-qmp-schema" } { "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" } } -
rgl revised this gist
May 3, 2020 . 1 changed file with 12 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,17 @@ After you open the socket, the first command is always: { "execute": "qmp_capabilities" } ``` Then you can either execute human or machine friendly commands. **NB** For a more easy way to execute commands you should use [0xef53/qmp-shell](https://github.com/0xef53/qmp-shell). ## Human friendly commands examples ```json { "execute": "human-monitor-command", "arguments": { "command-line": "help" } } ``` ## Machine friendly commands examples ```bash #query-pci @@ -59,3 +69,4 @@ Then you can execute any of the following examples. * https://github.com/qemu/qemu/blob/v4.2.0/qapi/net.json * https://github.com/qemu/qemu/blob/v4.2.0/scripts/qmp/qom-tree * https://github.com/qemu/qemu/tree/v4.2.0/python/qemu * https://github.com/0xef53/qmp-shell -
rgl revised this gist
May 3, 2020 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,17 @@ # QEMU Machine Protocol (QMP) socket Start QEMU with QMP UNIX socket and connect: ```bash ./qemu-system-x86_64.exe -qmp unix:test.socket,server,nowait ... nc -U test.socket ``` Or start QEMU with QMP TCP socket and connect: ```bash ./qemu-system-x86_64.exe -qmp tcp:127.0.0.1:12345,server,nowait ... nc localhost 12345 ``` # Examples -
rgl revised this gist
May 3, 2020 . 1 changed file with 26 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,36 @@ # QEMU Machine Protocol (QMP) socket Start QEMU with QMP TCP socket and connect: ```bash ./qemu-system-x86_64.exe -qmp tcp:127.0.0.1:12345,server,nowait ... nc localhost 12345 ``` Or start QEMU with QMP UNIX socket and connect: ```bash ./qemu-system-x86_64.exe -qmp unix:test.socket,server,nowait ... nc -U test.socket ``` # Examples After you open the socket, the first command is always: ```json { "execute": "qmp_capabilities" } ``` Then you can execute any of the following examples. ```bash #query-pci #query-dump #query-machines ``` ```json { "execute": "query-qmp-schema" } { "execute": "qom-list", "arguments": { "path": "/" } } { "execute": "qom-list", "arguments": { "path": "/machine" } } -
rgl revised this gist
May 3, 2020 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,13 @@ nc localhost 12345 { "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" } } { "execute": "query-rx-filter", "arguments": { "name": "hub0port0" } } ``` -
rgl revised this gist
May 3, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,6 +28,6 @@ nc localhost 12345 # References * https://github.com/qemu/qemu/blob/v4.2.0/qapi/net.json * https://github.com/qemu/qemu/blob/v4.2.0/scripts/qmp/qom-tree * https://github.com/qemu/qemu/tree/v4.2.0/python/qemu -
rgl revised this gist
May 3, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,3 +30,4 @@ nc localhost 12345 * https://github.com/qemu/qemu/blob/f57587c7d47b35b2d9b31def3a74d81bdb5475d7/qapi/net.json * https://github.com/qemu/qemu/blob/f57587c7d47b35b2d9b31def3a74d81bdb5475d7/scripts/qmp/qom-tree * https://github.com/qemu/qemu/tree/f57587c7d47b35b2d9b31def3a74d81bdb5475d7/python/qemu -
rgl revised this gist
May 2, 2020 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,14 @@ ```bash #query-pci #query-dump #query-machines ./qemu-system-x86_64.exe -qmp tcp:127.0.0.1:12345,server,nowait nc localhost 12345 ``` ```json { "execute": "qmp_capabilities" } { "execute": "query-qmp-schema" } { "execute": "qom-list", "arguments": { "path": "/" } } @@ -23,6 +24,9 @@ nc localhost 12345 { "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": "query-rx-filter", "arguments": { "name": "hub0port0" } } ``` # References * https://github.com/qemu/qemu/blob/f57587c7d47b35b2d9b31def3a74d81bdb5475d7/qapi/net.json * https://github.com/qemu/qemu/blob/f57587c7d47b35b2d9b31def3a74d81bdb5475d7/scripts/qmp/qom-tree -
rgl created this gist
May 2, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ query-pci query-dump query-machines ./qemu-system-x86_64.exe -qmp tcp:127.0.0.1:12345,server,nowait nc localhost 12345 { "execute": "qmp_capabilities" } { "execute": "query-qmp-schema" } { "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": "query-rx-filter", "arguments": { "name": "hub0port0" } } https://github.com/qemu/qemu/blob/f57587c7d47b35b2d9b31def3a74d81bdb5475d7/qapi/net.json https://github.com/qemu/qemu/blob/f57587c7d47b35b2d9b31def3a74d81bdb5475d7/scripts/qmp/qom-tree