[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/40] qapi: Fix generation of 'size' builtin type
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 04/40] qapi: Fix generation of 'size' builtin type |
Date: |
Tue, 5 May 2015 18:46:50 +0200 |
From: Eric Blake <address@hidden>
We were missing the 'size' builtin type (which means that QAPI using
[ 'size' ] would fail to compile).
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
scripts/qapi.py | 1 +
tests/qapi-schema/qapi-schema-test.json | 3 ++-
tests/qapi-schema/qapi-schema-test.out | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 2b5775d..d470347 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -29,6 +29,7 @@ builtin_types = {
'uint16': 'QTYPE_QINT',
'uint32': 'QTYPE_QINT',
'uint64': 'QTYPE_QINT',
+ 'size': 'QTYPE_QINT',
}
def error_path(parent):
diff --git a/tests/qapi-schema/qapi-schema-test.json
b/tests/qapi-schema/qapi-schema-test.json
index d43b5fd..84f0f07 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -74,7 +74,8 @@
'u64': ['uint64'],
'number': ['number'],
'boolean': ['bool'],
- 'string': ['str'] } }
+ 'string': ['str'],
+ 'sizes': ['size'] } }
# testing commands
{ 'command': 'user_def_cmd', 'data': {} }
diff --git a/tests/qapi-schema/qapi-schema-test.out
b/tests/qapi-schema/qapi-schema-test.out
index 08d7304..915a61b 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -12,7 +12,7 @@
OrderedDict([('union', 'UserDefFlatUnion'), ('base', 'UserDefUnionBase'),
('discriminator', 'enum1'), ('data', OrderedDict([('value1', 'UserDefA'),
('value2', 'UserDefB'), ('value3', 'UserDefB')]))]),
OrderedDict([('union', 'UserDefFlatUnion2'), ('base', 'UserDefUnionBase'),
('discriminator', 'enum1'), ('data', OrderedDict([('value1', 'UserDefC'),
('value2', 'UserDefB'), ('value3', 'UserDefA')]))]),
OrderedDict([('union', 'UserDefAnonUnion'), ('discriminator', OrderedDict()),
('data', OrderedDict([('uda', 'UserDefA'), ('s', 'str'), ('i', 'int')]))]),
- OrderedDict([('union', 'UserDefNativeListUnion'), ('data',
OrderedDict([('integer', ['int']), ('s8', ['int8']), ('s16', ['int16']),
('s32', ['int32']), ('s64', ['int64']), ('u8', ['uint8']), ('u16', ['uint16']),
('u32', ['uint32']), ('u64', ['uint64']), ('number', ['number']), ('boolean',
['bool']), ('string', ['str'])]))]),
+ OrderedDict([('union', 'UserDefNativeListUnion'), ('data',
OrderedDict([('integer', ['int']), ('s8', ['int8']), ('s16', ['int16']),
('s32', ['int32']), ('s64', ['int64']), ('u8', ['uint8']), ('u16', ['uint16']),
('u32', ['uint32']), ('u64', ['uint64']), ('number', ['number']), ('boolean',
['bool']), ('string', ['str']), ('sizes', ['size'])]))]),
OrderedDict([('command', 'user_def_cmd'), ('data', OrderedDict())]),
OrderedDict([('command', 'user_def_cmd1'), ('data', OrderedDict([('ud1a',
'UserDefOne')]))]),
OrderedDict([('command', 'user_def_cmd2'), ('data', OrderedDict([('ud1a',
'UserDefOne'), ('*ud1b', 'UserDefOne')])), ('returns', 'UserDefTwo')]),
--
1.9.3
- [Qemu-devel] [PULL 00/40] drop qapi nested structs, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 01/40] qapi: Add copyright declaration on docs, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 05/40] qapi: Require ASCII in schema, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 03/40] qapi: Simplify builtin type handling, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 12/40] qapi: Prepare for catching more semantic parse errors, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 07/40] qapi: Better error messages for bad enums, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 09/40] qapi: Clean up test coverage of simple unions, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 06/40] qapi: Add some enum tests, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 04/40] qapi: Fix generation of 'size' builtin type,
Markus Armbruster <=
- [Qemu-devel] [PULL 10/40] qapi: Forbid base without discriminator in unions, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 14/40] qapi: Rename anonymous union type in test, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 13/40] qapi: Segregate anonymous unions into alternates in generator, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 15/40] qapi: Document new 'alternate' meta-type, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 11/40] qapi: Tighten checking of unions, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 02/40] qapi: Document type-safety considerations, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 21/40] qapi: Allow true, false and null in schema json, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 19/40] qapi: Add tests of redefined expressions, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 27/40] qapi: More rigorous checking for type safety bypass, Markus Armbruster, 2015/05/05
- [Qemu-devel] [PULL 31/40] qapi: Forbid 'type' in schema, Markus Armbruster, 2015/05/05