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:
committed by
Markus Armbruster
parent
4e86df1732
commit
167d913f34
@@ -1690,8 +1690,8 @@ Example::
|
||||
}
|
||||
|
||||
retval = qmp_my_command(arg.arg1, &err);
|
||||
error_propagate(errp, err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user