From: Luiz Capitulino <lcapitulino@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: eblake@redhat.com, Lei Li <lilei@linux.vnet.ibm.com>,
armbru@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC v3 ATCH 0/5] char: expose CirMemCharDriver and provide QMP interface
Date: Wed, 19 Sep 2012 14:40:54 -0300 [thread overview]
Message-ID: <20120919144054.21e4ed5e@doriath.home> (raw)
In-Reply-To: <87vcfizntj.fsf@codemonkey.ws>
On Wed, 12 Sep 2012 20:58:00 -0500
Anthony Liguori <aliguori@us.ibm.com> wrote:
> "Daniel P. Berrange" <berrange@redhat.com> writes:
>
> > On Wed, Sep 12, 2012 at 07:57:21PM +0800, Lei Li wrote:
> >> 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
> >
> > Unbounded disk usage is only relevant if telling QEMU to write directly
> > to its file backend. If you use a socket backend the mgmt app can provide
> > whatever policy it desires.
> >
> >> So we want to use a circular buffer in QEMU instead, and then OpenStack
> >> can periodically read the buffer in QEMU and log it.
> >
> > With any circular buffer you obviously have a race condition where
> > the buffer may overflow before the application can consume the data.
> > By implementing the circular buffer in QEMU you are imposing a
> > specific policy for overflow on the applications using QEMU, namely
> > that data gets overwritten/lost.
> >
> > If the circular buffering is done outside QEMU, then the application
> > can implement a variety of policies on overflow. At the very least
> > they can detect when overflow would occur, and insert a marker to
> > the effect that there is a log discontinuity. Or they can pause the
> > VM for a period of time, or reduce its scheduling priority, or any
> > number of different things.
> >
> > The further advantage of doing it outside QEMU, is that OpenStack will
> > work with all existing QEMU/KVM/libvirt versions.
>
> I'm not sure what is the best solution for libvirt and OpenStack but I
> think you're missing a few key points.
>
> CDS doesn't propagate flow control to the guest (in some cases, it
> simply can't because hardware doesn't). That means that there has to be
> some policy in QEMU about what to do with data that cannot be written to
> a socket.
>
> Today we simply drop new data. This adds a mechanism where we drop old
> data. For some cases, dropping old data is much nicer than dropping new
> data.
>
> But there are other compelling use-cases for this beyond libvirt. This
> will allow us to implement a 'console' command which will be pretty nice
> within HMP.
>
> It also provides a very nice way to write tests. It's much easier to
> use something like this from qtest than it is to setup a socket in in
> listen mode and then queue incoming data to be read.
Sorry for catching up with this late, and hopefully my idea won't be
stupid.
But what about adding a fd backend chardev, which allows for i/o through
an fd passed by the client. Then we could add monitor_fd_add(), so that
internal qemu code (ie. hmp_console()) could add an fd to the monitor's poll.
That should eliminate the internal buffer and allow for the console
command.
prev parent reply other threads:[~2012-09-19 17:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=20120919144054.21e4ed5e@doriath.home \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=lilei@linux.vnet.ibm.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).