qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC v2 ATCH 0/4] char: expose MemoryCharDriver to users and provide QMP interface
@ 2012-08-23  5:14 Lei Li
  2012-08-23  5:14 ` [Qemu-devel] [PATCH 1/6] qemu-char: Convert MemCharDriver to circular buffer Lei Li
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Lei Li @ 2012-08-23  5:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, eblake, Lei Li

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(-)

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-09-03 16:20 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23  5:14 [Qemu-devel] [RFC v2 ATCH 0/4] char: expose MemoryCharDriver to users and provide QMP interface Lei Li
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

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).