From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXrsK-0004JZ-DE for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXrsG-0001cp-QU for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:21:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXrsG-0001aY-58 for qemu-devel@nongnu.org; Fri, 04 Sep 2015 10:21:52 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BB0782CAB33 for ; Fri, 4 Sep 2015 14:21:51 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84ELnSc024816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 4 Sep 2015 10:21:51 -0400 From: Markus Armbruster Date: Fri, 4 Sep 2015 16:21:39 +0200 Message-Id: <1441376500-14784-33-git-send-email-armbru@redhat.com> In-Reply-To: <1441376500-14784-1-git-send-email-armbru@redhat.com> References: <1441376500-14784-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL 32/33] docs/qapi-code-gen.txt: Fix QAPI schema examples List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- docs/qapi-code-gen.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index b4d4a01..ff16df2 100644 --- a/docs/qapi-code-gen.txt +++ b/docs/qapi-code-gen.txt @@ -300,7 +300,6 @@ an implicit C enum 'NameKind' is created, corresponding to the union the union can be named 'max', as this would collide with the implicit enum. The value for each branch can be of any type. - A flat union definition specifies a struct as its base, and avoids nesting on the wire. All branches of the union must be complex types, and the top-level fields of the union dictionary on @@ -314,7 +313,7 @@ adding a common field 'readonly', renaming the discriminator to something more applicable, and reducing the number of {} required on the wire: - { 'enum': 'BlockdevDriver', 'data': [ 'raw', 'qcow2' ] } + { 'enum': 'BlockdevDriver', 'data': [ 'file', 'qcow2' ] } { 'struct': 'BlockdevCommonOptions', 'data': { 'driver': 'BlockdevDriver', 'readonly': 'bool' } } { 'union': 'BlockdevOptions', @@ -350,7 +349,7 @@ is identical on the wire to: { 'struct': 'Base', 'data': { 'type': 'Enum' } } { 'struct': 'Branch1', 'data': { 'data': 'str' } } { 'struct': 'Branch2', 'data': { 'data': 'int' } } - { 'union': 'Flat': 'base': 'Base', 'discriminator': 'type', + { 'union': 'Flat', 'base': 'Base', 'discriminator': 'type', 'data': { 'one': 'Branch1', 'two': 'Branch2' } } -- 2.4.3