qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1
Date: Mon, 07 Mar 2011 09:59:04 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

On 03/07/2011 09:08 AM, Stefan Hajnoczi wrote:
On Mon, Mar 7, 2011 at 1:22 AM, Anthony Liguori<address@hidden>  wrote:
More information about QAPI can be found on the wiki:

http://wiki.qemu.org/Features/QAPI
Thanks for the good documentation.  A few thoughts:

A "Naming Conventions" section would be a helpful summary of the
different entities that .json schemas describe (events, enums, struct,
functions) and what format their names need to conform to.  It seems
like C identifier rules apply but you also used '-' in names.

Yes, this was on my TODO for qmp-schema.json and I've just not gotten around to it. I'll do it for the next version.

The *optional notation for struct fields could also be used for
function arguments instead of using a separate dict there.  I'm
suggesting this for consistency because users currently need to learn
two ways of expressing optional elements.

Yeah, I've been thinking the same.

The signals and slots magic makes sense when looking at the patches,
but I wasn't confident about their semantics just by reading the
documentation.  I had a vague idea about why the Event struct is
needed but didn't fully understand.  Perhaps it's just me but I wanted
to mention it in case you want to polish up that section.

Okay, I'll add more docs.

How do async commands work?  You mentioned them when talking about
QAPI but it's not obvious to me that there is any "native" support for
async commands?

Async commands are interesting..

Generating async commands with QAPI is easy. Errors are propagated now so the callback would just need to take the return value and error type. It would need to be a special callback type for each function but that's easy with the code generator.

Async commands are problematic from the client perspective though. I think there are two relevant use-cases for client software. There's the probably most dominant, I don't really care about small pauses users who are going to be executing the RPCs synchronously either using libqmp or Python. They may use threading to have some parallelism but generally, the expectation is going to be that QEMU doesn't introduce too much delay in processing a given RPC.

OTOH, there are users that will be purely event driven that will treat every RPC asynchronously. In both cases, it's more or less all-or-nothing. Having some commands delay for really long periods of time means that you either force users to treat some commands specially, or you force all users into an event driven model.

And of course, if you have async commands, you need to cancel commands, and then the context is within a single QMP session which means that you need to figure out what to do if you drop the session while an async command is executing. For instance, if a management tool executes the migrate command, and it's implemented as an async command, if the management tool loses it's connection, should migration be automatically cancelled?

I'm really on the fence about async commands. At the moment, I'm leaning towards just not every implementing them.

Regards,

Anthony Liguori

Stefan





reply via email to

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