qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Adam Litke <agl@us.ibm.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix hanging user monitor when using balloon command
Date: Fri, 26 Feb 2010 14:44:58 -0600	[thread overview]
Message-ID: <1267217098.3308.6.camel@aglitke> (raw)
In-Reply-To: <20100226172617.7e037e1e@redhat.com>

On Fri, 2010-02-26 at 17:26 -0300, Luiz Capitulino wrote:
>  This patch fixes both. One question, though:
> 
> > @@ -2332,6 +2331,7 @@ static int do_balloon(Monitor *mon, const QDict *params,
> >          return -1;
> >      }
> >  
> > +    cb(opaque, NULL);
> >      return 0;
> >  }
> 
>  Can't (or shouldn't) this be called by common code upon handler
> completion?

The explicit cb() call is only needed for synchronous commands that want
to use this API.  For asynchronous commands, the top-half (ie.
do_info_balloon) returns right away and the callback is called when the
asynchronous command completes (in hw/virtio-balloon.c).  Since
do_balloon() is completely finished when it returns, it has to manually
call cb().

If we decide to merge all commands into this new API in the future, then
we could have common code call the cb() for all synchronous commands.
For now, I just implemented do_balloon() this way as a proof of concept
to show that synchronous commands can use the API. 

-- 
Thanks,
Adam

  reply	other threads:[~2010-02-26 20:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12 20:55 [Qemu-devel] [PATCH] Fix hanging user monitor when using balloon command Adam Litke
2010-02-16 13:55 ` Daniel P. Berrange
2010-02-19 21:47 ` Anthony Liguori
2010-02-22 16:51   ` Adam Litke
2010-02-26 20:26     ` Luiz Capitulino
2010-02-26 20:44       ` Adam Litke [this message]
2010-03-08 17:05     ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2010-02-12 20:14 Adam Litke

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=1267217098.3308.6.camel@aglitke \
    --to=agl@us.ibm.com \
    --cc=lcapitulino@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).