aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi/common.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-02-11 10:36:05 +0100
committerEric Blake <eblake@redhat.com>2018-03-02 13:45:57 -0600
commiteb815e248f50cde9ab86eddd57eca5019b71ca78 (patch)
treec81f963410bea870f6d2f8f546c00632bed4c6f5 /scripts/qapi/common.py
parentbb46af41b9e7328626d2ecd37e48acbeb6832bc0 (diff)
qapi: Move qapi-schema.json to qapi/, rename generated files
Move qapi-schema.json to qapi/, so it's next to its modules, and all files get generated to qapi/, not just the ones generated for modules. Consistently name the generated files qapi-MODULE.EXT: qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch]. This gets rid of the temporary hacks in scripts/qapi/commands.py, scripts/qapi/events.py, and scripts/qapi/common.py. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180211093607.27351-28-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> [eblake: Fix trailing dot in tpm.c, undo temporary hack for OSX toolchain] Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi/common.py')
-rw-r--r--scripts/qapi/common.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index e0b88f1896..97e9060b67 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -1775,11 +1775,10 @@ def c_enum_const(type_name, const_name, prefix=None):
type_name = prefix
return camel_to_upper(type_name) + '_' + c_name(const_name, False).upper()
-# Temporary HACK for '/':
if hasattr(str, 'maketrans'):
- c_name_trans = str.maketrans('.-/', '___')
+ c_name_trans = str.maketrans('.-', '__')
else:
- c_name_trans = string.maketrans('.-/', '___')
+ c_name_trans = string.maketrans('.-', '__')
# Map @name to a valid C identifier.