From dc8fb6df5a13f7231f88c78966f8a6c5306840b5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 6 Mar 2012 18:55:56 +0100 Subject: qapi: complete implementation of unions Signed-off-by: Paolo Bonzini Acked-by: Luiz Capitulino Signed-off-by: Kevin Wolf --- qapi-schema-test.json | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qapi-schema-test.json') diff --git a/qapi-schema-test.json b/qapi-schema-test.json index 2b38919..8c7f9f7 100644 --- a/qapi-schema-test.json +++ b/qapi-schema-test.json @@ -22,6 +22,16 @@ 'dict2': { 'userdef1': 'UserDefOne', 'string2': 'str' }, '*dict3': { 'userdef2': 'UserDefOne', 'string3': 'str' } } } } +# for testing unions +{ 'type': 'UserDefA', + 'data': { 'boolean': 'bool' } } + +{ 'type': 'UserDefB', + 'data': { 'integer': 'int' } } + +{ 'union': 'UserDefUnion', + 'data': { 'a' : 'UserDefA', 'b' : 'UserDefB' } } + # testing commands { 'command': 'user_def_cmd', 'data': {} } { 'command': 'user_def_cmd1', 'data': {'ud1a': 'UserDefOne'} } -- cgit v1.1