From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34516 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3Fco-00073m-UM for qemu-devel@nongnu.org; Fri, 25 Mar 2011 18:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q3Fcn-0005iz-K5 for qemu-devel@nongnu.org; Fri, 25 Mar 2011 18:36:58 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:38138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q3Fcn-0005iE-Cc for qemu-devel@nongnu.org; Fri, 25 Mar 2011 18:36:57 -0400 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p2PMI7Se025900 for ; Fri, 25 Mar 2011 18:18:07 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id EC57938C8038 for ; Fri, 25 Mar 2011 18:36:47 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2PMarxA401478 for ; Fri, 25 Mar 2011 18:36:53 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2PMaqCD014449 for ; Fri, 25 Mar 2011 18:36:53 -0400 Message-ID: <4D8D1902.6030201@linux.vnet.ibm.com> Date: Fri, 25 Mar 2011 17:36:50 -0500 From: Michael Roth MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [RFC][PATCH v1 00/11] QEMU Guest Agent: QMP-based host/guest communication (virtagent) References: <1301082479-4058-1-git-send-email-mdroth@linux.vnet.ibm.com> <4D8CFE51.6040905@linux.vnet.ibm.com> <4D8D1131.105@codemonkey.ws> In-Reply-To: <4D8D1131.105@codemonkey.ws> 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: Anthony Liguori Cc: aliguori@linux.vnet.ibm.com, agl@linux.vnet.ibm.com, qemu-devel@nongnu.org, Jes.Sorensen@redhat.com On 03/25/2011 05:03 PM, Anthony Liguori wrote: > On 03/25/2011 03:42 PM, Michael Roth wrote: >> On 03/25/2011 02:47 PM, Michael Roth wrote: >>> These apply on top of Anthony's glib tree, commit >>> 03d5927deb5e6baebaade1b4c8ff2428a85e125c currently, and can also be >>> obtained from: >>> git://repo.or.cz/qemu/mdroth.git qga_v1 >>> >>> The QGA-specific patches are in pretty rough shape, and there are >>> some outstanding issues that I'll note below. I just wanted to put >>> the general approach out there for consideration. Patch-level >>> comments/review are still much-appreciated though. >>> >>> However, patches 1-5 are general json/QAPI-related fixes. Anthony, >>> please consider pulling these into your glib tree. The json fix-ups >>> may need further evaluation, but I'm confident they're at least an >>> improvement. The QAPI ones are trivial fix-ups. >>> >>> ISSUES/TODOS: >>> >>> - QMP's async callbacks expect the command results to be >>> de-marshalled beforehand. This is completely infeasible to attempt >>> outside of the code generator, so this is a big area that needs to be >>> addressed. So for now, only the 'guest-ping' command works, since it >>> has no return value. The dummy "guest-view-file" command will cause >>> an error to be reported to the client. >> >> Well, not completely de-marshalled. > > I don't follow. Are you talking about async callbacks within QEMU? > Because that should be totally transparent to you. You'll receive a > qobject and you can do whatever you need with it. > Heh, I was terribly confused when I initially noted that issue...must've been looking at a function further up the return chain and convinced myself something outside qmp was expected to de-marshal, but that was handled elsewhere in qmp-marshal.c The follow-up was with regard to the much-lesser issue of dealing with something like: static void qmp_guest_view_file_cb(void *qmp__opaque, QObject *qmp__retval, Error *qmp__err) The generated code expects that to be a QObject of a certain type. On the QmpProxy side, we have a response from the guest in the form of a qdict, with the retval stored with the "return" key: { "return": } So you need to pull out to pass to the callback. I was under the impression that there was no generic qdict_get(), and that you were expected to know the type in advance. But... >> Basically just need a way to pull whatever is stored in the response >> qdict's "return" field out without specifying the QTYPE in advance... >> which exists in qdict.c:qdict_get_obj(), it's just not currently >> exposed to outside callers. > > Just use qdict_get()--but I still don't understand what the problem is. Argh! So that solves the "problem" completely. Thanks :) > > Regards, > > Anthony Liguori