[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/19] qapi: Fold normalize_features() into check_features()
From: |
Markus Armbruster |
Subject: |
[PULL 15/19] qapi: Fold normalize_features() into check_features() |
Date: |
Tue, 29 Oct 2019 11:22:24 +0100 |
check_features() is always called together with normalize_features():
the former in check_struct() and check_command(), the latter in their
caller check_exprs(). Fold the latter into the former.
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
---
scripts/qapi/expr.py | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index aa0fe69f99..66014e2bb2 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -173,17 +173,13 @@ def check_type(value, info, source,
check_type(arg['type'], info, key_source, allow_array=True)
-def normalize_features(features):
- if isinstance(features, list):
- features[:] = [f if isinstance(f, dict) else {'name': f}
- for f in features]
-
-
def check_features(features, info):
if features is None:
return
if not isinstance(features, list):
raise QAPISemError(info, "'features' must be an array")
+ features[:] = [f if isinstance(f, dict) else {'name': f}
+ for f in features]
for f in features:
source = "'features' member"
assert isinstance(f, dict)
@@ -347,7 +343,6 @@ def check_exprs(exprs):
check_keys(expr, info, meta,
['struct', 'data'], ['base', 'if', 'features'])
normalize_members(expr['data'])
- normalize_features(expr.get('features'))
check_struct(expr, info)
elif meta == 'command':
check_keys(expr, info, meta,
@@ -356,7 +351,6 @@ def check_exprs(exprs):
'gen', 'success-response', 'allow-oob',
'allow-preconfig'])
normalize_members(expr.get('data'))
- normalize_features(expr.get('features'))
check_command(expr, info)
elif meta == 'event':
check_keys(expr, info, meta,
--
2.21.0
- [PULL 02/19] tests/qapi-schema: Demonstrate command and event doc comment bugs, (continued)
- [PULL 02/19] tests/qapi-schema: Demonstrate command and event doc comment bugs, Markus Armbruster, 2019/10/29
- [PULL 07/19] qapi: De-duplicate entity documentation generation code, Markus Armbruster, 2019/10/29
- [PULL 04/19] tests/qapi-schema: Fix feature documentation testing, Markus Armbruster, 2019/10/29
- [PULL 01/19] tests/qapi-schema: Demonstrate feature and enum doc comment bugs, Markus Armbruster, 2019/10/29
- [PULL 09/19] qapi: Fix enum doc comment checking, Markus Armbruster, 2019/10/29
- [PULL 13/19] qapi: Eliminate .check_doc() overrides, Markus Armbruster, 2019/10/29
- [PULL 05/19] qemu-doc: Belatedly document QMP command deprecation, Markus Armbruster, 2019/10/29
- [PULL 10/19] qapi: Clean up doc comment checking for implicit union base, Markus Armbruster, 2019/10/29
- [PULL 14/19] qapi: Fold normalize_if() into check_if(), Markus Armbruster, 2019/10/29
- [PULL 06/19] qapi: Implement boxed event argument documentation, Markus Armbruster, 2019/10/29
- [PULL 15/19] qapi: Fold normalize_features() into check_features(),
Markus Armbruster <=
- [PULL 11/19] qapi: Fix doc comment checking for commands and events, Markus Armbruster, 2019/10/29
- [PULL 16/19] qapi: Fold normalize_enum() into check_enum(), Markus Armbruster, 2019/10/29
- [PULL 18/19] qapi: Polish reporting of bogus member documentation, Markus Armbruster, 2019/10/29
- [PULL 17/19] qapi: Lift features into QAPISchemaEntity, Markus Armbruster, 2019/10/29
- [PULL 19/19] qapi: Check feature documentation against the schema, Markus Armbruster, 2019/10/29
- [PULL 08/19] qapi: Split .connect_doc(), .check_doc() off .check(), Markus Armbruster, 2019/10/29
- Re: [PULL 00/19] QAPI patches for 2019-10-29, Peter Maydell, 2019/10/29