On Fri, 08 Jan 2010 11:01:31 -0600 Adam Litke <a...@us.ibm.com> wrote:
> On Thu, 2010-01-07 at 16:30 -0200, Luiz Capitulino wrote: > > On Thu, 7 Jan 2010 15:58:30 -0200 > > Luiz Capitulino <lcapitul...@redhat.com> wrote: > > > > > I like Daniel's idea too. In practice 'refresh-balloon' is going to > > > be Anthony's idea #1 for the QMP case, which seems the right way to > > > do it with QMP. > > > > Hm, something that has just occurred to me: it's easy to have > > async messages in the user Monitor, we could add a new type of > > user print callback called async_print. > > > > This new callback would be called by the Monitor when the async > > message API is called but we are in user mode. > > > > This is really today's user_print, but user data is printed > > asynchronously. > > There is one thing I am struggling with as I try to implement this > asynchronous behavior. How can I suspend the monitor thread to wait for > the stats update to come through? I see qemu_cond_timedwait(), but that > appears to only be used for a VM's cpu threads. I also see the bottom > half infrastructure, but I am not sure if that is appropriate either. IIUC, in QMP you won't wait at all and I believe suspend/resume should work on the user Monitor. You can use monitor_ctrl_mode() to know whether you're in QMP or not.