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