aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qapi/main.py')
-rw-r--r--scripts/qapi/main.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py
index f2ea6e0ce4..687d408aba 100644
--- a/scripts/qapi/main.py
+++ b/scripts/qapi/main.py
@@ -32,7 +32,8 @@ def generate(schema_file: str,
output_dir: str,
prefix: str,
unmask: bool = False,
- builtins: bool = False) -> None:
+ builtins: bool = False,
+ gen_tracing: bool = False) -> None:
"""
Generate C code for the given schema into the target directory.
@@ -49,7 +50,7 @@ def generate(schema_file: str,
schema = QAPISchema(schema_file)
gen_types(schema, output_dir, prefix, builtins)
gen_visit(schema, output_dir, prefix, builtins)
- gen_commands(schema, output_dir, prefix)
+ gen_commands(schema, output_dir, prefix, gen_tracing)
gen_events(schema, output_dir, prefix)
gen_introspect(schema, output_dir, prefix, unmask)
@@ -74,6 +75,12 @@ def main() -> int:
parser.add_argument('-u', '--unmask-non-abi-names', action='store_true',
dest='unmask',
help="expose non-ABI names in introspection")
+
+ # Option --gen-trace exists so we can avoid solving build system
+ # problems. TODO Drop it when we no longer need it.
+ parser.add_argument('--gen-trace', action='store_true',
+ help="add trace events to qmp marshals")
+
parser.add_argument('schema', action='store')
args = parser.parse_args()
@@ -88,7 +95,8 @@ def main() -> int:
output_dir=args.output_dir,
prefix=args.prefix,
unmask=args.unmask,
- builtins=args.builtins)
+ builtins=args.builtins,
+ gen_tracing=args.gen_trace)
except QAPIError as err:
print(f"{sys.argv[0]}: {str(err)}", file=sys.stderr)
return 1