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>
This commit is contained in:
Markus Armbruster 2015-06-27 16:48:14 +02:00
parent 9b090d42ae
commit 8102307f51
1 changed files with 7 additions and 6 deletions

View File

@ -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 = ""