From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTpkf-00046q-4z for qemu-devel@nongnu.org; Mon, 24 Aug 2015 07:17:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZTpkb-0003dF-VV for qemu-devel@nongnu.org; Mon, 24 Aug 2015 07:17:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTpkb-0003d9-Pl for qemu-devel@nongnu.org; Mon, 24 Aug 2015 07:17:17 -0400 From: Markus Armbruster References: <1438679896-5077-1-git-send-email-armbru@redhat.com> <1438679896-5077-21-git-send-email-armbru@redhat.com> <55D232AB.2080004@redhat.com> Date: Mon, 24 Aug 2015 13:17:14 +0200 In-Reply-To: <55D232AB.2080004@redhat.com> (Eric Blake's message of "Mon, 17 Aug 2015 12:14:51 -0700") Message-ID: <87io85os05.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 20/26] qapi: Fix to reject union command and event arguments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 08/04/2015 02:18 AM, Markus Armbruster wrote: >> A command's or event's 'data' must be a struct type, given either as a >> dictionary, or as struct type name. >> >> Commit dd883c6 tightened the checking there, but not enough: we still >> accept 'union'. Fix to reject it. >> >> We may want to support union types there, but we'll have to extend >> qapi-commands.py and qapi-events.py for it. >> >> Signed-off-by: Markus Armbruster >> --- >> scripts/qapi.py | 4 ++-- >> tests/qapi-schema/args-union.err | 1 + >> tests/qapi-schema/args-union.exit | 2 +- >> tests/qapi-schema/args-union.json | 2 +- >> tests/qapi-schema/args-union.out | 4 ---- >> 5 files changed, 5 insertions(+), 8 deletions(-) > > Our documentation is also wrong; you may want to squash this in: > > diff --git i/docs/qapi-code-gen.txt w/docs/qapi-code-gen.txt > index 688a60c..4652a75 100644 > --- i/docs/qapi-code-gen.txt > +++ w/docs/qapi-code-gen.txt > @@ -408,10 +408,9 @@ Client JSON Protocol command exchange. > The 'data' argument maps to the "arguments" dictionary passed in as > part of a Client JSON Protocol command. The 'data' member is optional > and defaults to {} (an empty dictionary). If present, it must be the > -string name of a complex type, a one-element array containing the name > -of a complex type, or a dictionary that declares an anonymous type > -with the same semantics as a 'struct' expression, with one exception > -noted below when 'gen' is used. > +string name of a complex type, or a dictionary that declares an > +anonymous type with the same semantics as a 'struct' expression, with > +one exception noted below when 'gen' is used. > > The 'returns' member describes what will appear in the "return" field > of a Client JSON Protocol reply on successful completion of a command. Will do, thanks!