[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 05/18] Monitor: Drop is_async_return()

From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 05/18] Monitor: Drop is_async_return()
Date: Wed, 29 Sep 2010 10:11:24 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100826 Lightning/1.0b1 Thunderbird/3.0.7

On 09/29/2010 08:28 AM, Luiz Capitulino wrote:
On Wed, 29 Sep 2010 13:21:08 +0200
Markus Armbruster<address@hidden>  wrote:

Luiz Capitulino<address@hidden>  writes:

If I understood it correcty, the is_async_return() logic was only
used to prevent QMP from issuing duplicated success responses
for asynchronous handlers.

However, QMP doesn't use do_info() anymore so this is dead logic
and (hopefully) can be safely dropped.
Looks like it.

Does anybody understand this async monitor stuff?
I guess I do, but every now and then it surprises me someway.

It's used only for
"info balloon" and "balloon".  It keeps getting in the way.  I'm sorely
tempted to rip it out and reimplement it after we're done refactoring
the monitor.
I've considered doing that, but then I realized that it's actually a good
interface with two serious problems:

   1. It's half done. A true async interface would provide a way to list and
      cancel requests (at the API level and in QMP/HMP)

   2. It got too complex, and that's so because of the current state of the
      Monitor code

My optimistic side is telling me that both problems can be solved during
the refactoring process: Monitor code will be simplified and the current
async interface could be used as the basis for the internal QMP API (which
should be async-only, but that's another discussion).

I think one of the ugly bits of QMP as a protocol is capabilities negotiation because it implies that QMP has stateful sessions.

Capabilities doesn't have to imply a stateful session but some of the things we've discussed in the past would (like event notification masking).

When you look at other RPCs like XML-RPC, REST, or even JSON-RPC over HTTP, in order to be used over HTTP it's important that the actual RPC session has no state because HTTP is stateless.

The reason this discussion matters is because today we have a Monitor object that all commands operate on and could potentially use to store state.

An alternative model would be to do away with the Monitor object used by the commands which means the commands have no way to store session state. The human monitor needs state because it's stateful but it's not clear that we need to do this with QMP.

I think the vast majority of the complexity of async is based on the fact that we have a session object and we make the session object globally available. I don't think this is really something we've ever considered with QMP though.


Anthony Liguori


Anthony Liguori

reply via email to

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