summaryrefslogtreecommitdiffstats
path: root/scripts/qapi-commands.py
diff options
context:
space:
mode:
authorMarkus Armbruster2015-06-27 16:48:14 +0200
committerMarkus Armbruster2015-09-04 15:47:15 +0200
commit8102307f51e68280ac965a140a87073d5c31e9a5 (patch)
treee2a46cf770206ee50a6d8ce5e771d872cb16184a /scripts/qapi-commands.py
parentqapi: Command returning anonymous type doesn't work, outlaw (diff)
downloadqemu-8102307f51e68280ac965a140a87073d5c31e9a5.tar.gz
qemu-8102307f51e68280ac965a140a87073d5c31e9a5.tar.xz
qemu-8102307f51e68280ac965a140a87073d5c31e9a5.zip
qapi-commands: Fix gen_err_check(e) for e and e != 'local_err'
gen_err_check() hard-codes 'local_err' instead of substituting the argument. Currently harmless, since all callers pass either None or 'local_err'. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi-commands.py')
-rw-r--r--scripts/qapi-commands.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 69029f58fb..3965ca8e9a 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -29,14 +29,15 @@ def generate_command_decl(name, args, ret_type):
ret_type=c_type(ret_type), name=c_name(name),
args=arglist).strip()
-def gen_err_check(errvar):
- if errvar:
- return mcgen('''
-if (local_err) {
+def gen_err_check(err):
+ if not err:
+ return ''
+ return mcgen('''
+if (%(err)s) {
goto out;
}
-''')
- return ''
+''',
+ err=err)
def gen_sync_call(name, args, ret_type):
ret = ""