aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-23 10:40:16 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-23 22:31:05 +0100
commitb86df374784897c58b965939c9913c2a6c590426 (patch)
treec5fff8cd91fad0cd850795b99f9e1ca5531e237f /scripts
parentef8b3829f6d194c856d7db34e14117e8ed90a396 (diff)
qapi: Rename pragma *-whitelist to *-exceptions
Rename pragma returns-whitelist to command-returns-exceptions, and name-case-whitelist to member-name-case-exceptions. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20210323094025.3569441-20-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi/expr.py4
-rw-r--r--scripts/qapi/parser.py8
-rw-r--r--scripts/qapi/schema.py2
-rw-r--r--scripts/qapi/source.py8
4 files changed, 11 insertions, 11 deletions
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index 7bd15559de..85493efbac 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -181,7 +181,7 @@ def check_type(value, info, source,
raise QAPISemError(info,
"%s should be an object or type name" % source)
- permit_upper = allow_dict in info.pragma.name_case_whitelist
+ permit_upper = allow_dict in info.pragma.member_name_exceptions
# value is a dictionary, check that each member is okay
for (key, arg) in value.items():
@@ -224,7 +224,7 @@ def check_enum(expr, info):
if prefix is not None and not isinstance(prefix, str):
raise QAPISemError(info, "'prefix' must be a string")
- permit_upper = name in info.pragma.name_case_whitelist
+ permit_upper = name in info.pragma.member_name_exceptions
members[:] = [m if isinstance(m, dict) else {'name': m}
for m in members]
diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index 8eed69333f..c16b8b6995 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -132,12 +132,12 @@ class QAPISchemaParser:
raise QAPISemError(info,
"pragma 'doc-required' must be boolean")
info.pragma.doc_required = value
- elif name == 'returns-whitelist':
+ elif name == 'command-returns-exceptions':
self._check_pragma_list_of_str(name, value, info)
- info.pragma.returns_whitelist = value
- elif name == 'name-case-whitelist':
+ info.pragma.command_returns_exceptions = value
+ elif name == 'member-name-exceptions':
self._check_pragma_list_of_str(name, value, info)
- info.pragma.name_case_whitelist = value
+ info.pragma.member_name_exceptions = value
else:
raise QAPISemError(info, "unknown pragma '%s'" % name)
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index ff16578f6d..703b446fd2 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -779,7 +779,7 @@ class QAPISchemaCommand(QAPISchemaEntity):
if self._ret_type_name:
self.ret_type = schema.resolve_type(
self._ret_type_name, self.info, "command's 'returns'")
- if self.name not in self.info.pragma.returns_whitelist:
+ if self.name not in self.info.pragma.command_returns_exceptions:
typ = self.ret_type
if isinstance(typ, QAPISchemaArrayType):
typ = self.ret_type.element_type
diff --git a/scripts/qapi/source.py b/scripts/qapi/source.py
index d7a79a9b8a..d8f9ec377f 100644
--- a/scripts/qapi/source.py
+++ b/scripts/qapi/source.py
@@ -21,10 +21,10 @@ class QAPISchemaPragma:
def __init__(self) -> None:
# Are documentation comments required?
self.doc_required = False
- # Whitelist of commands allowed to return a non-dictionary
- self.returns_whitelist: List[str] = []
- # Whitelist of entities allowed to violate case conventions
- self.name_case_whitelist: List[str] = []
+ # Commands allowed to return a non-dictionary
+ self.command_returns_exceptions: List[str] = []
+ # Types whose member names may violate case conventions
+ self.member_name_exceptions: List[str] = []
class QAPISourceInfo: