qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Avi Kivity <avi@redhat.com>,
	qemu-devel@nongnu.org, Adam Litke <agl@us.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] New API for asynchronous monitor commands (V2)
Date: Thu, 28 Jan 2010 16:37:16 -0200	[thread overview]
Message-ID: <20100128163716.11f909ed@doriath> (raw)
In-Reply-To: <4B61D782.1010800@redhat.com>

On Thu, 28 Jan 2010 19:29:22 +0100
Kevin Wolf <kwolf@redhat.com> wrote:

> Am 25.01.2010 19:18, schrieb Adam Litke:
> > Changes since V1:
> >  - Miscellaneous code cleanups (Thanks Luiz)
> > 
> > Qemu has a number of commands that can operate asynchronously (savevm, migrate,
> > etc) and it will be getting more.  For these commands, the user monitor needs
> > to be suspended, but QMP monitors could continue to to accept other commands.
> > This patch introduces a new command API that isolates the details of handling
> > different monitor types from the actual command execution.
> > 
> > A monitor command can use this API by implementing the mhandler.cmd_async
> > handler (or info_async if appropriate).  This function is responsible for
> > submitting the command and does not return any data although it may raise
> > errors.  When the command completes, the QMPCompletion callback should be
> > invoked with its opaque data and the command result.
> > 
> > The process for submitting and completing an asynchronous command is different
> > for QMP and user monitors.  A user monitor must be suspended at submit time and
> > resumed at completion time.  The user_print() function must be passed to the
> > QMPCompletion callback so the result can be displayed properly.  QMP monitors
> > are simpler.  No submit time setup is required.  When the command completes,
> > monitor_protocol_emitter() writes the result in JSON format.
> > 
> > This API can also be used to implement synchronous commands.  In this case, the
> > cmd_async handler should immediately call the QMPCompletion callback.  It is my
> > hope that this new interface will work for all commands, leading to a
> > drastically simplified monitor.c once all commands are ported.
> > 
> > Thanks to Anthony for helping me out with the initial design.
> > 
> > Signed-off-by: Adam Litke <agl@us.ibm.com>
> 
> This commit introduces a segfault on info pci for me. The following
> patch seems to make it work again. Is it correct or is rather info pci
> doing something wrong?

 Breaks others 'info' commands as well, I've submitted a proper fix already:

http://lists.gnu.org/archive/html/qemu-devel/2010-01/msg01965.html

      reply	other threads:[~2010-01-28 18:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 18:18 [Qemu-devel] [PATCH] New API for asynchronous monitor commands (V2) Adam Litke
2010-01-26 12:16 ` [Qemu-devel] " Luiz Capitulino
2010-01-27  0:07 ` [Qemu-devel] " Anthony Liguori
2010-01-28 18:29 ` Kevin Wolf
2010-01-28 18:37   ` 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=20100128163716.11f909ed@doriath \
    --to=lcapitulino@redhat.com \
    --cc=agl@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=kwolf@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).