Skip to content

Commit

Permalink
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Browse files Browse the repository at this point in the history
# By Luiz Capitulino
# Via Luiz Capitulino
* luiz/queue/qmp:
  QMP: qmp-events.txt: alphabetical order fix and other minor changes
  QMP: Update qmp-spec.txt
  QMP: Update README file
  QMP: QMP/ -> docs/qmp/
  QMP: fix qmp-commands.txt generation path
  QMP: add scripts/qmp

Message-id: 1379509422-29115-1-git-send-email-lcapitulino@redhat.com
  • Loading branch information
aliguori committed Sep 20, 2013
2 parents 92bfedb + 7b5ce8d commit f54c49e
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 147 deletions.
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -65,7 +65,7 @@ LIBS+=-lz $(LIBS_TOOLS)
HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)

ifdef BUILD_DOCS
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
ifdef CONFIG_VIRTFS
DOCS+=fsdev/virtfs-proxy-helper.1
endif
Expand Down Expand Up @@ -304,7 +304,7 @@ endif
install-doc: $(DOCS)
$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
$(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
ifdef CONFIG_POSIX
$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
$(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
Expand Down Expand Up @@ -398,7 +398,7 @@ qemu-options.texi: $(SRC_PATH)/qemu-options.hx
qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@," GEN $@")

QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@," GEN $@")

qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
Expand Down
88 changes: 0 additions & 88 deletions QMP/README

This file was deleted.

87 changes: 87 additions & 0 deletions docs/qmp/README
@@ -0,0 +1,87 @@
QEMU Machine Protocol
=====================

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

The QEMU Machine Protocol (QMP) allows applications to operate a
QEMU instance.

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

- Lightweight, text-based, easy to parse data format
- Asynchronous messages support (ie. events)
- Capabilities Negotiation

For detailed information on QMP's usage, please, refer to the following files:

o qmp-spec.txt QEMU Machine Protocol current specification
o qmp-commands.txt QMP supported commands (auto-generated at build-time)
o qmp-events.txt List of available asynchronous events

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

Usage
-----

You can use the -qmp option to enable QMP. For example, the following
makes QMP available on localhost port 4444:

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

However, for more flexibility and to make use of more options, the -mon
command-line option should be used. For instance, the following example
creates one HMP instance (human monitor) on stdio and one QMP instance
on localhost port 4444:

$ qemu [...] -chardev stdio,id=mon0 -mon chardev=mon0,mode=readline \
-chardev socket,id=mon1,host=localhost,port=4444,server,nowait \
-mon chardev=mon1,mode=control,pretty=on

Please, refer to QEMU's manpage for more information.

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

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

$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{
"QMP": {
"version": {
"qemu": {
"micro": 50,
"minor": 6,
"major": 1
},
"package": ""
},
"capabilities": [
]
}
}

{ "execute": "qmp_capabilities" }
{
"return": {
}
}

{ "execute": "query-status" }
{
"return": {
"status": "prelaunch",
"singlestep": false,
"running": false
}
}

Please, refer to the qapi-schema.json file for a complete command reference.

QMP wiki page
-------------

http://wiki.qemu.org/QMP
34 changes: 17 additions & 17 deletions QMP/qmp-events.txt → docs/qmp/qmp-events.txt
@@ -1,4 +1,4 @@
QEMU Monitor Protocol Events
QEMU Machine Protocol Events
============================

BALLOON_CHANGE
Expand Down Expand Up @@ -159,7 +159,7 @@ Note: The "ready to complete" status is always reset by a BLOCK_JOB_ERROR
event.

DEVICE_DELETED
-----------------
--------------

Emitted whenever the device removal completion is acknowledged
by the guest.
Expand Down Expand Up @@ -194,8 +194,22 @@ Data:
},
"timestamp": { "seconds": 1265044230, "microseconds": 450486 } }

GUEST_PANICKED
--------------

Emitted when guest OS panic is detected.

Data:

- "action": Action that has been taken (json-string, currently always "pause").

Example:

{ "event": "GUEST_PANICKED",
"data": { "action": "pause" } }

NIC_RX_FILTER_CHANGED
-----------------
---------------------

The event is emitted once until the query command is executed,
the first event will always be emitted.
Expand Down Expand Up @@ -486,17 +500,3 @@ Example:

Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
followed respectively by the RESET, SHUTDOWN, or STOP events.

GUEST_PANICKED
--------------

Emitted when guest OS panic is detected.

Data:

- "action": Action that has been taken (json-string, currently always "pause").

Example:

{ "event": "GUEST_PANICKED",
"data": { "action": "pause" } }

0 comments on commit f54c49e

Please sign in to comment.