qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC v3 ATCH 0/5] char: expose CirMemCharDriver and provide QMP interface
@ 2012-09-12 11:57 Lei Li
  2012-09-12 11:57 ` [Qemu-devel] [PATCH 1/5] qemu-char: Add new char device CirMemCharDriver Lei Li
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Lei Li @ 2012-09-12 11:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, Lei Li, eblake, armbru, lcapitulino

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',
           'format': 'str', 'control': 'str' } }

{ 'command': 'memchar-read',
  'data': {'chardev': 'str', 'size': 'int',
           'format': 'str', 'control': 'str' },
  'returns': 'str' }

Expose CirMemCharDriver via the command line like:

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

Introduce HMP command 'console' like:

(qemu) console foo

Note:
Now all of the feature were implemented, this series is just a
sketch and not completely tested. Please comment and let me know
if this seems like the direction we should be headed, your suggestion
would be very appreciated!

Known issues:
There are still some problems I am fixing,
  - The circularMemoryDriver need to be improved.
  - For the 'block' option as sync command, will support it later when
    we gain the necessary infrastructure.
  - The HMP command 'console' still have problems to be fixed. 

Changes since v2:
  - Add congestion mechanism. For the 'block' option as sync command,
    will support it later when we gain the necessary infrastructure
    enhancement.
  - Add HMP 'console' command so that can interact with multiple
    chardevs via a single monitor socket.
  - Make the circular buffer backend and the current MemCharDriver
    live in parallel, expose a new char backend with circular buffer
    CirMemCharDriver suggested by Luiz.
  - Other fixs from Eric and Markus.

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.


Lei Li (5):
  qemu-char: Add new char device CirMemCharDriver
  Expose CirMemCharDriver via command line
  QAPI: Introduce memchar-write QMP command
  QAPI: Introduce memchar-read QMP command
  HMP: Introduce console command

 hmp-commands.hx  |   72 ++++++++++++++++++
 hmp.c            |   79 ++++++++++++++++++++
 hmp.h            |    3 +
 monitor.c        |   18 +++++
 monitor.h        |    2 +
 qapi-schema.json |   96 ++++++++++++++++++++++++
 qemu-char.c      |  212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-config.c    |    3 +
 qemu-options.hx  |   10 +++
 qmp-commands.hx  |   76 +++++++++++++++++++
 10 files changed, 571 insertions(+), 0 deletions(-)

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [Qemu-devel] [PATCH 0/5 V4] char: add CirMemCharDriver and provide QMP interface
@ 2012-10-21 16:47 Lei Li
  2012-10-21 16:48 ` [Qemu-devel] [PATCH 4/5] QAPI: Introduce memchar-read QMP command Lei Li
  0 siblings, 1 reply; 22+ messages in thread
From: Lei Li @ 2012-10-21 16:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, aliguori, Lei Li, lcapitulino

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',
           'format': 'str', 'control': 'str' } }

{ 'command': 'memchar-read',
  'data': {'chardev': 'str', 'size': 'int',
           'format': 'str', 'control': 'str' },
  'returns': 'str' }

Expose CirMemCharDriver via the command line like:

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

Introduce HMP command 'console' like:

(qemu) console foo

Note:
Now all of the feature were implemented, and the pervious comments
are fixed up too. Please comment and let me know if there is anything
else need to be improved. Your suggestion would be very appreciated!

Changes since v3:
  - Improve the algorithm of circular buffer based on Anthony's
    suggestion.
  - Some changes suggested by Luiz and Blue.
  - And other fixups.

Changes since v2:
  - Add congestion mechanism. For the 'block' option as sync command,
    will support it later when we gain the necessary infrastructure
    enhancement.
  - Add HMP 'console' command so that can interact with multiple
    chardevs via a single monitor socket.
  - Make the circular buffer backend and the current MemCharDriver
    live in parallel, expose a new char backend with circular buffer
    CirMemCharDriver suggested by Luiz.
  - Other fixs from Eric and Markus.

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.


Lei Li (5):
  qemu-char: Add new char backend CirMemCharDriver
  Expose CirMemCharDriver via command line
  QAPI: Introduce memchar-write QMP command
  QAPI: Introduce memchar-read QMP command
  HMP: Introduce console command

 hmp-commands.hx  |   72 +++++++++++++++++++
 hmp.c            |   99 +++++++++++++++++++++++
 hmp.h            |    3 +
 monitor.c        |   15 ++++
 monitor.h        |    3 +
 qapi-schema.json |   96 +++++++++++++++++++++++++
 qemu-char.c      |  217 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-config.c    |    3 +
 qemu-options.hx  |   10 +++
 qmp-commands.hx  |   89 +++++++++++++++++++++
 10 files changed, 607 insertions(+), 0 deletions(-)

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

end of thread, other threads:[~2012-10-22 18:42 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-12 11:57 [Qemu-devel] [RFC v3 ATCH 0/5] char: expose CirMemCharDriver and provide QMP interface Lei Li
2012-09-12 11:57 ` [Qemu-devel] [PATCH 1/5] qemu-char: Add new char device CirMemCharDriver Lei Li
2012-09-19 17:43   ` Luiz Capitulino
2012-09-12 11:57 ` [Qemu-devel] [PATCH 2/5] Expose CirMemCharDriver via command line Lei Li
2012-09-19 17:45   ` Luiz Capitulino
2012-09-12 11:57 ` [Qemu-devel] [PATCH 3/5] QAPI: Introduce memchar-write QMP command Lei Li
2012-09-14 17:18   ` Blue Swirl
2012-09-19 18:05   ` Luiz Capitulino
2012-09-20  7:42     ` Lei Li
2012-09-20 20:05       ` Luiz Capitulino
2012-09-12 11:57 ` [Qemu-devel] [PATCH 4/5] QAPI: Introduce memchar-read " Lei Li
2012-09-12 15:01   ` Eric Blake
2012-09-14 17:29   ` Blue Swirl
2012-09-12 11:57 ` [Qemu-devel] [PATCH 5/5] HMP: Introduce console command Lei Li
2012-09-14 17:15   ` Blue Swirl
2012-09-19 18:11   ` Luiz Capitulino
2012-09-12 15:53 ` [Qemu-devel] [RFC v3 ATCH 0/5] char: expose CirMemCharDriver and provide QMP interface Avi Kivity
2012-09-12 16:12 ` Daniel P. Berrange
2012-09-13  1:58   ` Anthony Liguori
2012-09-19 17:40     ` Luiz Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2012-10-21 16:47 [Qemu-devel] [PATCH 0/5 V4] char: add " Lei Li
2012-10-21 16:48 ` [Qemu-devel] [PATCH 4/5] QAPI: Introduce memchar-read QMP command Lei Li
2012-10-22 18:43   ` Luiz Capitulino

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