]> Git Repo - qemu.git/blobdiff - scripts/qapi-gen.py
works with less than base ISA qemu-system-riscv32 -M virt -bios none -kernel output...
[qemu.git] / scripts / qapi-gen.py
old mode 100755 (executable)
new mode 100644 (file)
index 2100ca1..f3518d2
@@ -1,41 +1,19 @@
-#!/usr/bin/env python
-# QAPI generator
-#
+#!/usr/bin/env python3
+
 # This work is licensed under the terms of the GNU GPL, version 2 or later.
 # See the COPYING file in the top-level directory.
 
-import sys
-from qapi.common import parse_command_line, QAPISchema
-from qapi.types import gen_types
-from qapi.visit import gen_visit
-from qapi.commands import gen_commands
-from qapi.events import gen_events
-from qapi.introspect import gen_introspect
-from qapi.doc import gen_doc
-
-
-def main(argv):
-    (input_file, output_dir, prefix, opts) = \
-        parse_command_line('bu', ['builtins', 'unmask-non-abi-names'])
+"""
+QAPI code generation execution shim.
 
-    opt_builtins = False
-    opt_unmask = False
+This standalone script exists primarily to facilitate the running of the QAPI
+code generator without needing to install the python module to the current
+execution environment.
+"""
 
-    for o, a in opts:
-        if o in ('-b', '--builtins'):
-            opt_builtins = True
-        if o in ('-u', '--unmask-non-abi-names'):
-            opt_unmask = True
-
-    schema = QAPISchema(input_file)
-
-    gen_types(schema, output_dir, prefix, opt_builtins)
-    gen_visit(schema, output_dir, prefix, opt_builtins)
-    gen_commands(schema, output_dir, prefix)
-    gen_events(schema, output_dir, prefix)
-    gen_introspect(schema, output_dir, prefix, opt_unmask)
-    gen_doc(schema, output_dir, prefix)
+import sys
 
+from qapi import main
 
 if __name__ == '__main__':
-    main(sys.argv)
+    sys.exit(main.main())
This page took 0.025418 seconds and 4 git commands to generate.