summaryrefslogtreecommitdiffstats
path: root/scripts/qapi-commands.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-commands.py
parent43cbeffb19877c62cbe0aaf08b2f235d98d71340 (diff)
parentb690d679c1ca65d71b0544a2331d50e9f0f95116 (diff)
downloadhqemu-06b4f00d53637f2c16a62c2cbaa30bffb045cf88.zip
hqemu-06b4f00d53637f2c16a62c2cbaa30bffb045cf88.tar.gz
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-commands.py')
-rw-r--r--scripts/qapi-commands.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 9734ab0..8d9096f 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -369,9 +369,10 @@ def gen_command_def_prologue(prefix="", proxy=False):
try:
- opts, args = getopt.gnu_getopt(sys.argv[1:], "chp:o:m",
+ opts, args = getopt.gnu_getopt(sys.argv[1:], "chp:i:o:m",
["source", "header", "prefix=",
- "output-dir=", "type=", "middle"])
+ "input-file=", "output-dir=",
+ "type=", "middle"])
except getopt.GetoptError, err:
print str(err)
sys.exit(1)
@@ -389,6 +390,8 @@ do_h = 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 ("-t", "--type"):
@@ -420,7 +423,7 @@ except os.error, e:
if e.errno != errno.EEXIST:
raise
-exprs = parse_schema(sys.stdin)
+exprs = parse_schema(input_file)
commands = filter(lambda expr: expr.has_key('command'), exprs)
commands = filter(lambda expr: not expr.has_key('gen'), commands)
OpenPOWER on IntegriCloud