union-base-union.json (763B)
1# For now, we require the base to be a struct without variants 2# TODO: It would be possible to allow a union as a base, as long as all 3# permutations of QMP names exposed by base do not clash with any QMP 4# member names added by local variants. 5{ 'enum': 'TestEnum', 6 'data': [ 'value1', 'value2' ] } 7{ 'struct': 'TestTypeA', 8 'data': { 'string': 'str' } } 9{ 'struct': 'TestTypeB', 10 'data': { 'integer': 'int' } } 11{ 'enum': 'Enum', 'data': [ 'kind1', 'kind2' ] } 12{ 'union': 'UnionBase', 13 'base': { 'type': 'Enum' }, 14 'discriminator': 'type', 15 'data': { 'kind1': 'TestTypeA', 16 'kind2': 'TestTypeB' } } 17{ 'union': 'TestUnion', 18 'base': 'UnionBase', 19 'discriminator': 'type', 20 'data': { 'kind1': 'TestTypeA', 21 'kind2': 'TestTypeB' } }