mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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>
This commit is contained in:
parent
bb46af41b9
commit
eb815e248f
35 changed files with 119 additions and 134 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue