aboutsummaryrefslogtreecommitdiff
path: root/QMP/README
blob: 35a80c73e4fcf3b202aa00f8079ca308f57a24ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
                          QEMU Monitor Protocol
                          =====================

Introduction
-------------

The QEMU Monitor Protocol (QMP) allows applications to communicate with
QEMU's Monitor.

QMP is JSON[1] based and has the following features:

- Lightweight, text-based, easy to parse data format
- Asynchronous events support 
- Stability

For more information, please, refer to the following files:

o qmp-spec.txt      QEMU Monitor Protocol current specification
o qmp-commands.txt  QMP supported commands
o qmp-events.txt    List of available asynchronous events

There are also two simple Python scripts available:

o qmp-shell       A shell
o vm-info         Show some information about the Virtual Machine

[1] http://www.json.org

Usage
-----

To enable QMP, QEMU has to be started in "control mode". There are
two ways of doing this, the simplest one is using the the '-qmp'
command-line option.

For example:

$ qemu [...] -qmp tcp:localhost:4444,server

Will start QEMU in control mode, waiting for a client TCP connection
on localhost port 4444.

It is also possible to use the '-mon' command-line option to have
more complex combinations. Please, refer to the QEMU's manpage for
more information.

Simple Testing
--------------

To manually test QMP one can connect with telnet and issue commands:

$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "query-version" }
{"return": {"qemu": "0.12.50", "package": ""}}

Contact
-------

http://www.linux-kvm.org/page/MonitorProtocol
Luiz Fernando N. Capitulino <lcapitulino@redhat.com>