]>
Commit | Line | Data |
---|---|---|
26d5a1cd LC |
1 | QEMU Monitor Protocol |
2 | ===================== | |
3 | ||
4 | Introduction | |
5 | ------------- | |
6 | ||
052f1b9b LC |
7 | The QEMU Monitor Protocol (QMP) allows applications to communicate with |
8 | QEMU's Monitor. | |
26d5a1cd | 9 | |
052f1b9b LC |
10 | QMP 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 | |
16 | For more information, please, refer to the following files: | |
17 | ||
b40292e7 JK |
18 | o qmp-spec.txt QEMU Monitor Protocol current specification |
19 | o qmp-commands.txt QMP supported commands | |
20 | o qmp-events.txt List of available asynchronous events | |
26d5a1cd LC |
21 | |
22 | There are also two simple Python scripts available: | |
23 | ||
24 | o qmp-shell A shell | |
052f1b9b | 25 | o vm-info Show some information about the Virtual Machine |
26d5a1cd LC |
26 | |
27 | [1] http://www.json.org | |
28 | ||
29 | Usage | |
30 | ----- | |
31 | ||
052f1b9b LC |
32 | To enable QMP, QEMU has to be started in "control mode". There are |
33 | two ways of doing this, the simplest one is using the the '-qmp' | |
34 | command-line option. | |
26d5a1cd LC |
35 | |
36 | For example: | |
37 | ||
052f1b9b | 38 | $ qemu [...] -qmp tcp:localhost:4444,server |
26d5a1cd LC |
39 | |
40 | Will start QEMU in control mode, waiting for a client TCP connection | |
41 | on localhost port 4444. | |
42 | ||
052f1b9b LC |
43 | It is also possible to use the '-mon' command-line option to have |
44 | more complex combinations. Please, refer to the QEMU's manpage for | |
45 | more information. | |
46 | ||
47 | Simple Testing | |
48 | -------------- | |
49 | ||
50 | To manually test QMP one can connect with telnet and issue commands: | |
26d5a1cd LC |
51 | |
52 | $ telnet localhost 4444 | |
052f1b9b | 53 | Trying 127.0.0.1... |
26d5a1cd LC |
54 | Connected to localhost. |
55 | Escape 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 | |
62 | Contact | |
63 | ------- | |
64 | ||
65 | http://www.linux-kvm.org/page/MonitorProtocol | |
66 | Luiz Fernando N. Capitulino <lcapitulino@redhat.com> |