diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/qapi/commands.py | 7 | ||||
-rw-r--r-- | scripts/qapi/common.py | 5 | ||||
-rw-r--r-- | scripts/qapi/events.py | 9 | ||||
-rw-r--r-- | scripts/qapi/introspect.py | 4 | ||||
-rw-r--r-- | scripts/qapi/types.py | 6 | ||||
-rw-r--r-- | scripts/qapi/visit.py | 6 |
6 files changed, 11 insertions, 26 deletions
diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 953449171b..21a7e0dbe6 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -232,13 +232,6 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor): self._regy = '' self._visited_ret_types = {} - # Temporary HACK: - def _module_basename(self, what, name): - basename = QAPISchemaModularCVisitor._module_basename(self, what, name) - if name == self._main_module: - return re.sub(r'qapi-commands', 'qmp-commands', basename) - return basename - def _begin_module(self, name): self._visited_ret_types[self._genc] = set() commands = self._module_basename('qapi-commands', name) 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. diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 5ad6708491..3dc523cf39 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -157,20 +157,13 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor): self._enum_name = c_name(prefix + 'QAPIEvent', protect=False) self._event_names = [] - # Temporary HACK: - def _module_basename(self, what, name): - basename = QAPISchemaModularCVisitor._module_basename(self, what, name) - if name == self._main_module: - return re.sub(r'qapi-events', 'qapi-event', basename) - return basename - def _begin_module(self, name): types = self._module_basename('qapi-types', name) visit = self._module_basename('qapi-visit', name) self._genc.add(mcgen(''' #include "qemu/osdep.h" #include "qemu-common.h" -#include "%(prefix)sqapi-event.h" +#include "%(prefix)sqapi-events.h" #include "%(visit)s.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index f571cc134c..f66c397fb0 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -44,7 +44,7 @@ class QAPISchemaGenIntrospectVisitor(QAPISchemaMonolithicCVisitor): def __init__(self, prefix, unmask): QAPISchemaMonolithicCVisitor.__init__( - self, prefix, 'qmp-introspect', + self, prefix, 'qapi-introspect', ' * QAPI/QMP schema introspection', __doc__) self._unmask = unmask self._schema = None @@ -53,7 +53,7 @@ class QAPISchemaGenIntrospectVisitor(QAPISchemaMonolithicCVisitor): self._name_map = {} self._genc.add(mcgen(''' #include "qemu/osdep.h" -#include "%(prefix)sqmp-introspect.h" +#include "%(prefix)sqapi-introspect.h" ''', prefix=prefix)) diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py index 2a3c502cf6..64d9c0fb37 100644 --- a/scripts/qapi/types.py +++ b/scripts/qapi/types.py @@ -177,8 +177,8 @@ class QAPISchemaGenTypeVisitor(QAPISchemaModularCVisitor): self._genc.preamble_add(mcgen(''' #include "qemu/osdep.h" #include "qapi/dealloc-visitor.h" -#include "qapi-builtin-types.h" -#include "qapi-builtin-visit.h" +#include "qapi/qapi-builtin-types.h" +#include "qapi/qapi-builtin-visit.h" ''')) self._genh.preamble_add(mcgen(''' #include "qapi/util.h" @@ -195,7 +195,7 @@ class QAPISchemaGenTypeVisitor(QAPISchemaModularCVisitor): ''', types=types, visit=visit)) self._genh.preamble_add(mcgen(''' -#include "qapi-builtin-types.h" +#include "qapi/qapi-builtin-types.h" ''')) def visit_begin(self, schema): diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index de09966643..5d72d8936c 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -274,11 +274,11 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor): #include "qemu/osdep.h" #include "qemu-common.h" #include "qapi/error.h" -#include "qapi-builtin-visit.h" +#include "qapi/qapi-builtin-visit.h" ''')) self._genh.preamble_add(mcgen(''' #include "qapi/visitor.h" -#include "qapi-builtin-types.h" +#include "qapi/qapi-builtin-types.h" ''', prefix=prefix)) @@ -295,7 +295,7 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor): ''', visit=visit, prefix=self._prefix)) self._genh.preamble_add(mcgen(''' -#include "qapi-builtin-visit.h" +#include "qapi/qapi-builtin-visit.h" #include "%(types)s.h" ''', |