Received: from eggs.gnu.org ([2001:4830:134:3::10]:34016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXREs-0001Mo-0m for qemu-devel@nongnu.org; Thu, 03 Sep 2015 05:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXREn-0005xJ-1w for qemu-devel@nongnu.org; Thu, 03 Sep 2015 05:55:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXREm-0005x8-Sv for qemu-devel@nongnu.org; Thu, 03 Sep 2015 05:55:20 -0400 From: Markus Armbruster Date: Thu, 3 Sep 2015 11:55:17 +0200 Message-Id: <1441274118-13702-1-git-send-email-armbru@redhat.com> In-Reply-To: <1440780366-7177-1-git-send-email-armbru@redhat.com> References: <1440780366-7177-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 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 Cc: mdroth@linux.vnet.ibm.com Signed-off-by: Markus Armbruster --- 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