]> git.proxmox.com Git - mirror_qemu.git/blame - docs/qmp/README
Merge remote-tracking branch 'kwolf/for-anthony' into staging
[mirror_qemu.git] / docs / qmp / README
CommitLineData
52bbff77 1 QEMU Machine Protocol
26d5a1cd
LC
2 =====================
3
4Introduction
52bbff77 5------------
26d5a1cd 6
52bbff77
LC
7The QEMU Machine Protocol (QMP) allows applications to operate a
8QEMU instance.
26d5a1cd 9
52bbff77 10QMP is JSON[1] based and features the following:
052f1b9b
LC
11
12- Lightweight, text-based, easy to parse data format
d29f3196
LC
13- Asynchronous messages support (ie. events)
14- Capabilities Negotiation
26d5a1cd 15
d29f3196 16For detailed information on QMP's usage, please, refer to the following files:
26d5a1cd 17
52bbff77 18o qmp-spec.txt QEMU Machine Protocol current specification
d29f3196 19o qmp-commands.txt QMP supported commands (auto-generated at build-time)
b40292e7 20o qmp-events.txt List of available asynchronous events
26d5a1cd 21
26d5a1cd
LC
22[1] http://www.json.org
23
24Usage
25-----
26
52bbff77
LC
27You can use the -qmp option to enable QMP. For example, the following
28makes QMP available on localhost port 4444:
d29f3196 29
52bbff77 30$ qemu [...] -qmp tcp:localhost:4444,server,nowait
26d5a1cd 31
52bbff77
LC
32However, for more flexibility and to make use of more options, the -mon
33command-line option should be used. For instance, the following example
34creates one HMP instance (human monitor) on stdio and one QMP instance
35on localhost port 4444:
26d5a1cd 36
52bbff77
LC
37$ qemu [...] -chardev stdio,id=mon0 -mon chardev=mon0,mode=readline \
38 -chardev socket,id=mon1,host=localhost,port=4444,server,nowait \
39 -mon chardev=mon1,mode=control,pretty=on
26d5a1cd 40
d29f3196 41Please, refer to QEMU's manpage for more information.
052f1b9b
LC
42
43Simple Testing
44--------------
45
d29f3196 46To manually test QMP one can connect with telnet and issue commands by hand:
26d5a1cd
LC
47
48$ telnet localhost 4444
052f1b9b 49Trying 127.0.0.1...
26d5a1cd
LC
50Connected to localhost.
51Escape character is '^]'.
52bbff77
LC
52{
53 "QMP": {
54 "version": {
55 "qemu": {
56 "micro": 50,
57 "minor": 6,
58 "major": 1
59 },
60 "package": ""
61 },
62 "capabilities": [
63 ]
64 }
65}
d29f3196 66
52bbff77
LC
67{ "execute": "qmp_capabilities" }
68{
69 "return": {
70 }
71}
72
73{ "execute": "query-status" }
74{
75 "return": {
76 "status": "prelaunch",
77 "singlestep": false,
78 "running": false
79 }
80}
81
82Please, refer to the qapi-schema.json file for a complete command reference.
83
84QMP wiki page
85-------------
26d5a1cd 86
a18b2ce2 87http://wiki.qemu.org/QMP