[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 07/22] qapi: pass long form enum to make_enum_mem
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v8 07/22] qapi: pass long form enum to make_enum_members |
Date: |
Thu, 13 Dec 2018 16:37:09 +0400 |
This will allow to get rid of short form handling in a following
patch.
Signed-off-by: Marc-André Lureau <address@hidden>
Suggested-by: Markus Armbruster <address@hidden>
---
scripts/qapi/common.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index bb928d2f7d..569e397147 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1648,9 +1648,10 @@ class QAPISchema(object):
self.the_empty_object_type = QAPISchemaObjectType(
'q_empty', None, None, None, None, [], None)
self._def_entity(self.the_empty_object_type)
- qtype_values = self._make_enum_members(['none', 'qnull', 'qnum',
- 'qstring', 'qdict', 'qlist',
- 'qbool'])
+
+ qtypes = ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist',
'qbool']
+ qtype_values = self._make_enum_members([{'name': n} for n in qtypes])
+
self._def_entity(QAPISchemaEnumType('QType', None, None, None,
qtype_values, 'QTYPE'))
--
2.20.0
- [Qemu-devel] [PATCH v8 00/22] qapi: add #if pre-processor conditions to generated code (part 2), Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 01/22] qapi: Do not define enumeration value explicitly, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 02/22] qapi: change enum visitor and gen_enum* to take QAPISchemaMember, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 03/22] tests: print enum type members more like object type members, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 04/22] qapi: factor out checking for keys, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 05/22] qapi: improve reporting of unknown or missing keys, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 06/22] qapi: add a dictionary form with 'name' key for enum members, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 07/22] qapi: pass long form enum to make_enum_members,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v8 08/22] qapi: simplify make_enum_members(), Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 09/22] qapi: add 'if' to enum members, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 10/22] qapi-events: add 'if' condition to implicit event enum, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 11/22] qapi: rename allow_dict to allow_implicit, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 13/22] qapi: add 'if' to implicit struct members, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 12/22] qapi: add a dictionary form for TYPE, Marc-André Lureau, 2018/12/13
- [Qemu-devel] [PATCH v8 14/22] qapi: add an error in case a discriminator is conditional, Marc-André Lureau, 2018/12/13