Revision 052f1b9b

b/QMP/README
4 4
Introduction
5 5
-------------
6 6

  
7
The QEMU Monitor Protocol (QMP) is a JSON[1] based protocol for QEMU.
7
The QEMU Monitor Protocol (QMP) allows applications to communicate with
8
QEMU's Monitor.
8 9

  
9
By using it applications can control QEMU in reliable and "parseable" way,
10
QMP also provides asynchronous events support.
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
11 15

  
12 16
For more information, please, refer to the following files:
13 17

  
14
o qmp-spec.txt    QEMU Monitor Protocol current draft specification
18
o qmp-spec.txt    QEMU Monitor Protocol current specification
15 19
o qmp-events.txt  List of available asynchronous events
16 20

  
17 21
There are also two simple Python scripts available:
18 22

  
19 23
o qmp-shell       A shell
20
o vm-info         Show some informations about the Virtal Machine
24
o vm-info         Show some information about the Virtual Machine
21 25

  
22 26
[1] http://www.json.org
23 27

  
24 28
Usage
25 29
-----
26 30

  
27
To enable QMP, QEMU has to be started in "control mode". This is done
28
by passing the flag "control" to the "-monitor" command-line option.
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.
29 34

  
30 35
For example:
31 36

  
32
$ qemu [...] -monitor control,tcp:localhost:4444,server
37
$ qemu [...] -qmp tcp:localhost:4444,server
33 38

  
34 39
Will start QEMU in control mode, waiting for a client TCP connection
35 40
on localhost port 4444.
36 41

  
37
To manually test it you can connect with telnet and issue commands:
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:
38 50

  
39 51
$ telnet localhost 4444
40
Trying ::1...
52
Trying 127.0.0.1...
41 53
Connected to localhost.
42 54
Escape character is '^]'.
43 55
{"QMP": {"capabilities": []}}
44 56
{ "execute": "query-version" }
45
{"return": "0.11.50"}
57
{"return": {"qemu": "0.11.50", "package": ""}}
46 58

  
47 59
Contact
48 60
-------

Also available in: Unified diff