From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIxc8-0007L6-Va for qemu-devel@nongnu.org; Tue, 23 Jun 2009 00:28:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIxc4-0007Iw-Kw for qemu-devel@nongnu.org; Tue, 23 Jun 2009 00:28:08 -0400 Received: from [199.232.76.173] (port=35665 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIxc4-0007Iq-Ij for qemu-devel@nongnu.org; Tue, 23 Jun 2009 00:28:04 -0400 Received: from mx2.redhat.com ([66.187.237.31]:32778) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIxc4-000323-2X for qemu-devel@nongnu.org; Tue, 23 Jun 2009 00:28:04 -0400 Date: Tue, 23 Jun 2009 01:27:55 -0300 From: Luiz Capitulino Message-ID: <20090623012755.7cade792@doriath> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC 00/11] QEMU Monitor Protocol List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, ehabkost@redhat.com, jan.kiszka@siemens.com, dlaor@redhat.com, avi@redhat.com Hi there, It is already known that QEMU does not provide a way for applications to control it at the "machine level", that is, the current Monitor interface was designed with human interaction in mind. This problem has already been discussed at least twice, the last thead on the topic can be found here: http://lists.gnu.org/archive/html/qemu-devel/2009-01/msg00655.html Basically, some people have suggested to export Monitor's functionality through a C library, while others have suggested a simple text protocol. This patch series implements a prototype of the text protocol approach, which I called QEMU Monitor Protocol, or QMP. I have chosen the text protocol because: 1. It is easier to implement 2. If needed, a C library can be built on top of it QMP has the following features: o Easy to be parsed by programs o Extensible o Asynchronous messages support With this series I hope to get as much feedback as possible on the protocol specification and the implementation, and also have a merge plan. To enable QMP one has to start QEMU with: $ qemu [...] -monitor control, For example: $ qemu [...] -monitor control,tcp:localhost:4444,server Then the application can open a TCP connection to localhost:4444 and speak to QEMU using QMP. A full protocol specification can be found (and discussed) in the first patch of this series. Some additional comments: o Don't take the implementation too serious, it is just a hac^W prototype o Available commands: quit, cont, stop, system_reset, system_powerdown, balloon, info balloon, info blockstats o Available events: reboot, shutdown, powerdown Luiz Capitulino (11): QMP: Introduce specification file QMP: Introduce MONITOR_USE_CONTROL flag QMP: Introduce protocol print functions QMP: Make monitor_handle_command() QMP aware QMP: Introduce control mode chardev handling QMP: Introduce asynchronous events infrastructure QMP: Enable simple commands QMP: Port balloon command QMP: Port 'info blockstats' command QMP: Introduce basic events QMP: Command-line flag to enable control mode block.c | 18 ++-- monitor-protocol-spec.txt | 180 ++++++++++++++++++++++++++++++++++++++ monitor.c | 211 +++++++++++++++++++++++++++++++++++++++++++- monitor.h | 14 +++ qemu-tool.c | 16 ++++ vl.c | 8 ++- 6 files changed, 431 insertions(+), 16 deletions(-) create mode 100644 monitor-protocol-spec.txt