qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RESEND PATCH for 1.4 v10 0/3] char: Add CirMemCharDriver a


From: Lei Li
Subject: [Qemu-devel] [RESEND PATCH for 1.4 v10 0/3] char: Add CirMemCharDriver and provide QMP interface
Date: Wed, 23 Jan 2013 17:06:09 +0800

Hi Anthony,

Resubmit this series with your comments squashed in and Luiz's new 
comments fixed up. I will push console command part in another thread.

Thanks.

 
This patch series attempts to add new char backend CirMemCharDriver with
a circular buffer and expose it to users by introducing QMP interface
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': {'device': 'str', 'size': 'int', 'data': 'str',
           '*format': 'str' } }

{ 'command': 'memchar-read',
  'data': {'device': 'str', 'size': 'int', '*format': 'str' },
  'returns': 'MemCharRead' }

Expose CirMemCharDriver via the command line like:

qemu -chardev memory,id=foo,maxcapacity=65536 -serial chardev:foo

Note:
Now all of the feature were implemented, and the pervious comments
are fixed up too. Since this patch series have been for mailing list
for some time and missed 1.3, rebase it with minor fix.

Changes since v9:
  - Fixup comments from Luiz include:
    - Error report and doc improvment.
    - Get rid of cirmem_chr_is_full check and just return an 
      empty string instead of an read error.
    - Add support to return the number of bytes read.

Changes since v8:
  - Squashed in the comments from Anthony.
  - Split the console command part out to another thread.

Changes since v7:
  - Rebase the code and fix the format error pointed by Eric.
  - Modify the version info.

Changes since v6:
  - Improve the document based on Luiz's comments.
  - Keep pointing to the right position in cbuf for the case producer
    and consumer might overflow for long running VMs pointed by Luiz.
  - Limit the size of read_data to the amount of bytes available in the
    circular buffer.
  - Other fixups from Luiz.

Changes since v5:
  - Avoid writing the IAC information to the queue.
  - Grammar of the doc for command line options improved from Eric.

Changes since v4:
  - Get rid of all CongestionControl bits, and assume a dropping behavior
    based on Luiz's suggestion for now. Will add it when we add async
    support to QMP.
  - Squashed the patches about CirMemCharDriver in one.
  - Other fixups from Luiz.

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 (3):
  qemu-char: Add new char backend CirMemCharDriver
  QAPI: Introduce memchar-write QMP command
  QAPI: Introduce memchar-read QMP command

 hmp-commands.hx  |   39 ++++++++++
 hmp.c            |   30 ++++++++
 hmp.h            |    2 +
 qapi-schema.json |   74 ++++++++++++++++++++
 qemu-char.c      |  204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-options.hx  |   10 +++
 qmp-commands.hx  |   66 +++++++++++++++++
 7 files changed, 425 insertions(+), 0 deletions(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]