qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lei Li <lilei@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, eblake@redhat.com,
	Lei Li <lilei@linux.vnet.ibm.com>
Subject: [Qemu-devel] [RFC v2 ATCH 0/4] char: expose MemoryCharDriver to users and provide QMP interface
Date: Thu, 23 Aug 2012 13:14:20 +0800	[thread overview]
Message-ID: <1345698866-19794-1-git-send-email-lilei@linux.vnet.ibm.com> (raw)

This RFC series attempts to convert the MemCharDriver to use a circular
buffer for input and output, expose it to users by introducing QMP commands
memchar_write and memchar_read and via the command line like the other
CharDriverStates.

Serial ports in qemu always use CharDriverStates as there backends,
Right now, all of our backends always try to write the data from the
guest to a socket or file. The concern from OpenStack is that this could
lead to unbounded disk space usage since they log the serial output.
For more detail of the background info:
https://bugs.launchpad.net/nova/+bug/832507

So we want to use a circular buffer in QEMU instead, and then OpenStack
can periodically read the buffer in QEMU and log it.

The QMP commands introduced like:

{ 'command': 'memchar_write',
  'data': {'chardev': 'str', 'size': 'int', 'data': 'str'} }

{ 'command': 'memchar_read',
  'data': {'chardev': 'str', 'size': 'int'},
  'returns': 'str' }

Expose MemCharDriver via the command line like:

qemu -chardev memchr,max-capacity=640k,id=foo -serial chardev:foo

Note:
This series is just a incomplete sketch and not completely tested which
I am still struggling with, but I want to get this out ealier to have
your suggestion. Please comment and let me know if this seems like the
direction we should be headed, thanks!

TODO:
1) Add congestion mechanism.
2) Add HMP "console" command so that can interact with multiple
   chardevs via a single monitor socket

Changes since v1:
  - Exposing the MemCharDriver via command line.
  - Support base64 data format suggested by Anthony and Eric.
  - Follow the new rule for the name of qmp command from Eric.

  For the comments of MemCharDriver improvment, which I am working on and
  will send out within v3 with the rest feature implemented in few days.


Lei Li (6):
  qemu-char: Convert MemCharDriver to circular buffer
  monitor: Adjust qmp_human_monitor_command to new MemCharDriver
  QAPI: Introduce memchar_write QMP command
  QAPI: Introduce memchar_read QMP command
  Fix enumeration typo error
  Expose MemCharDriver via command line

 hmp-commands.hx        |   32 ++++++++
 hmp.c                  |   30 ++++++++
 hmp.h                  |    2 +
 monitor.c              |    8 ++-
 qapi-schema-guest.json |    2 +-
 qapi-schema.json       |   69 +++++++++++++++++-
 qemu-char.c            |  190 +++++++++++++++++++++++++++++++++++++++++++-----
 qemu-char.h            |    2 +-
 qemu-config.c          |    3 +
 qemu-options.hx        |   10 +++
 qmp-commands.hx        |   64 ++++++++++++++++
 11 files changed, 388 insertions(+), 24 deletions(-)

             reply	other threads:[~2012-08-23  5:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23  5:14 Lei Li [this message]
2012-08-23  5:14 ` [Qemu-devel] [PATCH 1/6] qemu-char: Convert MemCharDriver to circular buffer Lei Li
2012-08-30 18:43   ` Luiz Capitulino
2012-08-23  5:14 ` [Qemu-devel] [PATCH 2/6] monitor: Adjust qmp_human_monitor_command to new MemCharDriver Lei Li
2012-08-30 18:51   ` Luiz Capitulino
2012-09-03 16:14     ` Lei Li
2012-09-03 16:21       ` Luiz Capitulino
2012-08-23  5:14 ` [Qemu-devel] [PATCH 3/6] QAPI: Introduce memchar_write QMP command Lei Li
2012-08-23  5:42   ` Eric Blake
2012-08-23  6:40     ` Lei Li
2012-08-31  7:26     ` Markus Armbruster
2012-08-30 19:17   ` Luiz Capitulino
2012-08-31  7:17   ` Markus Armbruster
2012-08-23  5:14 ` [Qemu-devel] [PATCH 4/6] QAPI: Introduce memchar_read " Lei Li
2012-08-23  5:46   ` Eric Blake
2012-08-23  7:30     ` Lei Li
2012-08-23  5:14 ` [Qemu-devel] [PATCH 5/6] Fix enumeration typo error Lei Li
2012-08-23  5:48   ` Eric Blake
2012-08-30 19:20   ` Luiz Capitulino
2012-08-31  6:52   ` Stefan Hajnoczi
2012-08-23  5:14 ` [Qemu-devel] [PATCH 6/6] Expose MemCharDriver via command line Lei Li
2012-08-31  7:02   ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345698866-19794-1-git-send-email-lilei@linux.vnet.ibm.com \
    --to=lilei@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).