mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qapi: Use returned bool to check for failure, manual part
The previous commit used Coccinelle to convert from checking the Error object to checking the return value. Convert a few more manually. Also tweak control flow in places to conform to the conventional "if error bail out" pattern. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20200707160613.848843-20-armbru@redhat.com>
This commit is contained in:
parent
62a35aaa31
commit
14217038bc
9 changed files with 44 additions and 56 deletions
|
@ -895,8 +895,8 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
|
|||
ThrottleLimits *argp;
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (!visit_type_ThrottleLimits(v, name, &argp, &local_err)) {
|
||||
goto ret;
|
||||
if (!visit_type_ThrottleLimits(v, name, &argp, errp)) {
|
||||
return;
|
||||
}
|
||||
qemu_mutex_lock(&tg->lock);
|
||||
throttle_get_config(&tg->ts, &cfg);
|
||||
|
@ -908,7 +908,6 @@ static void throttle_group_set_limits(Object *obj, Visitor *v,
|
|||
|
||||
unlock:
|
||||
qemu_mutex_unlock(&tg->lock);
|
||||
ret:
|
||||
qapi_free_ThrottleLimits(argp);
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue