aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-visit.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-05-09 15:46:34 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-05-09 15:46:34 +0100
commit06b4f00d53637f2c16a62c2cbaa30bffb045cf88 (patch)
tree4b3c8803e3947c3f1a87d4da1b5c77362dede250 /scripts/qapi-visit.py
parent43cbeffb19877c62cbe0aaf08b2f235d98d71340 (diff)
parentb690d679c1ca65d71b0544a2331d50e9f0f95116 (diff)
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp: (38 commits) Revert "qapi: Clean up superfluous null check in qapi_dealloc_type_str()" qapi: Document optional arguments' backwards compatibility qmp: use valid JSON in transaction example qmp: Don't use error_is_set() to suppress additional errors dump: Drop pointless error_is_set(), DumpState member errp qemu-option: Clean up fragile use of error_is_set() qga: Drop superfluous error_is_set() qga: Clean up fragile use of error_is_set() qapi: Clean up fragile use of error_is_set() tests/qapi-schema: Drop superfluous error_is_set() qapi: Drop redundant, unclean error_is_set() hmp: Guard against misuse of hmp_handle_error() qga: Use return values instead of error_is_set(errp) error: Consistently name Error ** objects errp, and not err qmp: Consistently name Error ** objects errp, and not err qga: Consistently name Error ** objects errp, and not err qmp hmp: Consistently name Error * objects err, and not errp pci-assign: assigned_initfn(): set monitor error in common error handler pci-assign: propagate errors from assign_intx() pci-assign: propagate errors from assign_device() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r--scripts/qapi-visit.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 45ce3a957a..c6579beed5 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -397,13 +397,14 @@ void visit_type_%(name)s(Visitor *m, %(name)s * obj, const char *name, Error **e
name=name)
try:
- opts, args = getopt.gnu_getopt(sys.argv[1:], "chbp:o:",
+ opts, args = getopt.gnu_getopt(sys.argv[1:], "chbp:i:o:",
["source", "header", "builtins", "prefix=",
- "output-dir="])
+ "input-file=", "output-dir="])
except getopt.GetoptError, err:
print str(err)
sys.exit(1)
+input_file = ""
output_dir = ""
prefix = ""
c_file = 'qapi-visit.c'
@@ -416,6 +417,8 @@ do_builtins = False
for o, a in opts:
if o in ("-p", "--prefix"):
prefix = a
+ elif o in ("-i", "--input-file"):
+ input_file = a
elif o in ("-o", "--output-dir"):
output_dir = a + "/"
elif o in ("-c", "--source"):
@@ -494,7 +497,7 @@ fdecl.write(mcgen('''
''',
prefix=prefix, guard=guardname(h_file)))
-exprs = parse_schema(sys.stdin)
+exprs = parse_schema(input_file)
# to avoid header dependency hell, we always generate declarations
# for built-in types in our header files and simply guard them