On 02/11/2018 03:35 AM, Markus Armbruster wrote:
The next commit will introduce a common driver program for all
generators.  The generators need to be modules for that.  qapi2texi.py
already is.  Make the other generators follow suit.

The changes are actually trivial.  Obvious in the diffs once you view
them with whitespace changes ignored.

Signed-off-by: Markus Armbruster <arm...@redhat.com>
Reviewed-by: Eric Blake <ebl...@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com>
---
  scripts/qapi-commands.py   | 43 ++++++++++++++++++--------------
  scripts/qapi-event.py      | 43 ++++++++++++++++++--------------
  scripts/qapi-introspect.py | 54 ++++++++++++++++++++++------------------
  scripts/qapi-types.py      | 56 ++++++++++++++++++++++-------------------
  scripts/qapi-visit.py      | 62 +++++++++++++++++++++++++---------------------
  5 files changed, 143 insertions(+), 115 deletions(-)

Urgh. One annoyance of this patch is that if you switch to another branch without the patch, leftover .pyc files in the source tree can cause weird errors until you 'rm -f scripts/qapi/*.pyc':

$ make -j3
  GEN     config-host.h
  GEN     qmp-commands.h
  GEN     qapi-types.h
Traceback (most recent call last):
  File "/home/eblake/qemu/scripts/qapi-commands.py", line 225, in <module>
    class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
NameError: name 'QAPISchemaVisitor' is not defined
Traceback (most recent call last):
  File "/home/eblake/qemu/scripts/qapi-types.py", line 168, in <module>
    class QAPISchemaGenTypeVisitor(QAPISchemaVisitor):
NameError: name 'QAPISchemaVisitor' is not defined
make: *** [Makefile:522: qapi-types.h] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:537: qmp-commands.h] Error 1

Not a show-stopper, but annoying when toggling between branches.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to