From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35473 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pwcq0-00021A-CK for qemu-devel@nongnu.org; Mon, 07 Mar 2011 10:59:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pwcpy-0000v5-QW for qemu-devel@nongnu.org; Mon, 07 Mar 2011 10:59:12 -0500 Received: from mail-qy0-f180.google.com ([209.85.216.180]:65188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pwcpy-0000ul-La for qemu-devel@nongnu.org; Mon, 07 Mar 2011 10:59:10 -0500 Received: by qyk10 with SMTP id 10so4742806qyk.4 for ; Mon, 07 Mar 2011 07:59:09 -0800 (PST) Message-ID: <4D7500C8.1080101@codemonkey.ws> Date: Mon, 07 Mar 2011 09:59:04 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 00/22] QAPI Round 1 References: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Adam Litke , Anthony Liguori , Markus Armbruster , Luiz Capitulino On 03/07/2011 09:08 AM, Stefan Hajnoczi wrote: > On Mon, Mar 7, 2011 at 1:22 AM, Anthony Liguori 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 >