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: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1
Date: Tue, 08 Mar 2011 15:45:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7

On 03/08/2011 03:35 PM, Anthony Liguori wrote:
On 03/08/2011 05:12 AM, Avi Kivity wrote:
On 03/07/2011 05:59 PM, Anthony Liguori wrote:

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..

Would there be anything in them other than starting each command in its own thread? If it then drops the right locks it can execute in parallel with other commands, if it doesn't, then it's synchronous (and presumably doesn't depend on external or guest events).

I've implemented them (for virt-agent) and I'll have it in v2 of round 1.

I use callbacks. If a function is marked to be async, it generates a signature like:

typedef void (GuestViewFileCompletionFunc)(void *qmp__opaque, const char * qmp__retval, Error *qmp__err); void qmp_guest_view_file(const char * filename, Error **err, GuestViewFileCompletionFunc *qmp__cc, void *qmp__opaque);

The handler just needs to squirrel away qmp__cc and qmp__opaque and call it whenever the command completes.

Okay. My preference would be threads, but we can always start with one model and use adapters to switch to another.

(and instead of an opaque/func pair, I'd do

typedef struct GuestViewFileCompletion {
    void (*complete)(struct GuestViewFileCompletion *gvfc);
} GuestViewFileCompletion;

so there's less squirrelling and more type-safetying.
)

(and gah, do we really need a vfs/rpc in qemu?)

--
error compiling committee.c: too many arguments to function




reply via email to

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