]> git.proxmox.com Git - qemu.git/blame - QMP/README
QMP: Introduce commands documentation
[qemu.git] / QMP / README
CommitLineData
26d5a1cd
LC
1 QEMU Monitor Protocol
2 =====================
3
4Introduction
5-------------
6
052f1b9b
LC
7The QEMU Monitor Protocol (QMP) allows applications to communicate with
8QEMU's Monitor.
26d5a1cd 9
052f1b9b
LC
10QMP is JSON[1] based and has the following features:
11
12- Lightweight, text-based, easy to parse data format
13- Asynchronous events support
14- Stability
26d5a1cd
LC
15
16For more information, please, refer to the following files:
17
b40292e7
JK
18o qmp-spec.txt QEMU Monitor Protocol current specification
19o qmp-commands.txt QMP supported commands
20o qmp-events.txt List of available asynchronous events
26d5a1cd
LC
21
22There are also two simple Python scripts available:
23
24o qmp-shell A shell
052f1b9b 25o vm-info Show some information about the Virtual Machine
26d5a1cd
LC
26
27[1] http://www.json.org
28
29Usage
30-----
31
052f1b9b
LC
32To enable QMP, QEMU has to be started in "control mode". There are
33two ways of doing this, the simplest one is using the the '-qmp'
34command-line option.
26d5a1cd
LC
35
36For example:
37
052f1b9b 38$ qemu [...] -qmp tcp:localhost:4444,server
26d5a1cd
LC
39
40Will start QEMU in control mode, waiting for a client TCP connection
41on localhost port 4444.
42
052f1b9b
LC
43It is also possible to use the '-mon' command-line option to have
44more complex combinations. Please, refer to the QEMU's manpage for
45more information.
46
47Simple Testing
48--------------
49
50To manually test QMP one can connect with telnet and issue commands:
26d5a1cd
LC
51
52$ telnet localhost 4444
052f1b9b 53Trying 127.0.0.1...
26d5a1cd
LC
54Connected to localhost.
55Escape character is '^]'.
ca9567e2
LC
56{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
57{ "execute": "qmp_capabilities" }
58{"return": {}}
26d5a1cd 59{ "execute": "query-version" }
ca9567e2 60{"return": {"qemu": "0.12.50", "package": ""}}
26d5a1cd
LC
61
62Contact
63-------
64
65http://www.linux-kvm.org/page/MonitorProtocol
66Luiz Fernando N. Capitulino <lcapitulino@redhat.com>