mirror of
https://github.com/qemu/qemu.git
synced 2024-12-01 07:43:35 +08:00
052f1b9be5
- Fix output description - Fix command-line usage notes - Minor improvements Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
64 lines
1.6 KiB
Plaintext
64 lines
1.6 KiB
Plaintext
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-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": {"capabilities": []}}
|
|
{ "execute": "query-version" }
|
|
{"return": {"qemu": "0.11.50", "package": ""}}
|
|
|
|
Contact
|
|
-------
|
|
|
|
http://www.linux-kvm.org/page/MonitorProtocol
|
|
Luiz Fernando N. Capitulino <lcapitulino@redhat.com>
|