Received: from eggs.gnu.org ([2001:4830:134:3::10]:36498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNhSC-0001ss-Bw for qemu-devel@nongnu.org; Thu, 14 Jul 2016 10:17:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNhS8-0000cY-2p for qemu-devel@nongnu.org; Thu, 14 Jul 2016 10:17:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNhS7-0000cS-Sv for qemu-devel@nongnu.org; Thu, 14 Jul 2016 10:17:23 -0400 From: Markus Armbruster References: <1468468228-27827-1-git-send-email-eblake@redhat.com> <1468468228-27827-9-git-send-email-eblake@redhat.com> Date: Thu, 14 Jul 2016 16:17:21 +0200 In-Reply-To: <1468468228-27827-9-git-send-email-eblake@redhat.com> (Eric Blake's message of "Wed, 13 Jul 2016 21:50:19 -0600") Message-ID: <87poqgpamm.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v9 08/17] qapi: Plumb in 'boxed' to qapi generator lower levels List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Michael Roth Eric Blake writes: > The next patch will add support for passing a qapi union type > as the 'data' of a command. But to do that, the user function > for implementing the command, as called by the generated > marshal command, must take the corresponding C struct as a > single boxed pointer, rather than a breakdown into one > parameter per member. Even without a union, being able to use > a C struct rather than a list of parameters can make it much > easier to handle coding with QAPI. > > This patch adds the internal plumbing of a 'boxed' flag > associated with each command and event. In several cases, > this means adding indentation, with one new dead branch and > the remaining branch being the original code more deeply > nested; this was done so that the new implementation in the > next patch is easier to review without also being mixed with > indentation changes. > > For this patch, no behavior or generated output changes, other > than the testsuite outputting the value of the new flag > (always False for now). > > Signed-off-by: Eric Blake > > --- > v9: change title, s/box/boxed/ > v8: improve commit message, defer some implementation, rebase without > gen_err_check() > v7: rebase to master > v6: rebase to earlier changes [...] > diff --git a/scripts/qapi-introspect.py b/scripts/qapi-introspect.py > index e0f926b..60e9877 100644 > --- a/scripts/qapi-introspect.py > +++ b/scripts/qapi-introspect.py > @@ -154,14 +154,14 @@ const char %(c_name)s[] = %(c_string)s; > for m in variants.variants]}) > > def visit_command(self, name, info, arg_type, ret_type, > - gen, success_response): > + gen, success_response, box): You missed a box here. Can touch up on commit. > arg_type = arg_type or self._schema.the_empty_object_type > ret_type = ret_type or self._schema.the_empty_object_type > self._gen_json(name, 'command', > {'arg-type': self._use_type(arg_type), > 'ret-type': self._use_type(ret_type)}) > > - def visit_event(self, name, info, arg_type): > + def visit_event(self, name, info, arg_type, box): Likewise. > arg_type = arg_type or self._schema.the_empty_object_type > self._gen_json(name, 'event', {'arg-type': self._use_type(arg_type)}) > [...]