From patchwork Mon Aug 17 19:14:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 508068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 065B01402B4 for ; Tue, 18 Aug 2015 05:36:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=comcast.net header.i=@comcast.net header.b=kwRmcuWp; dkim-atps=neutral Received: from localhost ([::1]:54722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRQDB-0003lQ-H0 for incoming@patchwork.ozlabs.org; Mon, 17 Aug 2015 15:36:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRPs6-0002Sj-CS for qemu-devel@nongnu.org; Mon, 17 Aug 2015 15:15:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRPs1-0003P0-Ob for qemu-devel@nongnu.org; Mon, 17 Aug 2015 15:15:02 -0400 Received: from resqmta-po-02v.sys.comcast.net ([96.114.154.161]:48728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRPs1-0003Ot-II for qemu-devel@nongnu.org; Mon, 17 Aug 2015 15:14:57 -0400 Received: from resomta-po-12v.sys.comcast.net ([96.114.154.236]) by resqmta-po-02v.sys.comcast.net with comcast id 5vEl1r00856HXL001vEwsC; Mon, 17 Aug 2015 19:14:56 +0000 Received: from [192.168.93.145] ([67.161.121.241]) by resomta-po-12v.sys.comcast.net with comcast id 5vEv1r00C5Cbvcb01vEvn3; Mon, 17 Aug 2015 19:14:56 +0000 To: Markus Armbruster , qemu-devel@nongnu.org References: <1438679896-5077-1-git-send-email-armbru@redhat.com> <1438679896-5077-21-git-send-email-armbru@redhat.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <55D232AB.2080004@redhat.com> Date: Mon, 17 Aug 2015 12:14:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1438679896-5077-21-git-send-email-armbru@redhat.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1439838896; bh=H24vDUyJ9bKW9vnBureP/xwvkJ4PfKeUnlmUvNo9Aww=; h=Received:Received:Subject:To:From:Message-ID:Date:MIME-Version: Content-Type; b=kwRmcuWpt+A7wjO6VjehpjKsuhfBK5F1PZ76TAhxAy6tj7LOj+K9Hyr/UvmZ1sj5k u+197DyQd9/dP+eKpAS+1Q4TWgcgb5H6GDgSUaBbU/EzzQBwPaIcSlw48btWoA1lxZ i3IfO4IaLqoGOskxkMGSJbSscHInQCiJJSfz0ZAFF0Xy7mGzPJkzsp+J1nBE+2Sm5s Bn5SO+TuCQcigxca56D0Y6AwGJ3O5mFHP0Q49izPWqrz4jOOqPAk7CfECkpYICHlG+ mjEAlVYS7jeFdXHcfrJwQq0umHL1oGXip1DZ8FZQo//tOu4DCxiAKiQyFUW8bn+hxl 6ZtpBw+gyycMQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 96.114.154.161 Cc: mdroth@linux.vnet.ibm.com Subject: Re: [Qemu-devel] [PATCH 20/26] qapi: Fix to reject union command and event arguments X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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.