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