mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi/commands: refactor error handling code
Move error_propagate() to if (err) and make "if (err)" block mandatory. This is to simplify further commit, which will bring trace events generation for QMP commands. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220126161130.3240892-3-vsementsov@virtuozzo.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
4e86df1732
commit
167d913f34
2 changed files with 8 additions and 4 deletions
|
@ -74,14 +74,18 @@ def gen_call(name: str,
|
|||
ret = mcgen('''
|
||||
|
||||
%(lhs)sqmp_%(c_name)s(%(args)s&err);
|
||||
error_propagate(errp, err);
|
||||
''',
|
||||
c_name=c_name(name), args=argstr, lhs=lhs)
|
||||
if ret_type:
|
||||
ret += mcgen('''
|
||||
|
||||
ret += mcgen('''
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
goto out;
|
||||
}
|
||||
''')
|
||||
|
||||
if ret_type:
|
||||
ret += mcgen('''
|
||||
|
||||
qmp_marshal_output_%(c_name)s(retval, ret, errp);
|
||||
''',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue