mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
qapi: Smooth another visitor error checking pattern
Convert visit_type_FOO(v, ..., &ptr, &err); ... if (err) { ... } to visit_type_FOO(v, ..., &ptr, errp); ... if (!ptr) { ... } for functions that set @ptr to non-null / null on success / error. Eliminate error_propagate() that are now unnecessary. Delete @err that are now unused. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200707160613.848843-40-armbru@redhat.com>
This commit is contained in:
parent
4bc6d7ee0e
commit
b11a093c60
15 changed files with 36 additions and 79 deletions
|
@ -2064,7 +2064,6 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
|
|||
QDict *qdict;
|
||||
Visitor *v;
|
||||
BlockDriverState *bs = NULL;
|
||||
Error *local_err = NULL;
|
||||
int ret;
|
||||
|
||||
static const QDictRenames opt_renames[] = {
|
||||
|
@ -2105,11 +2104,9 @@ static int coroutine_fn vhdx_co_create_opts(BlockDriver *drv,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
|
||||
visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
|
||||
visit_free(v);
|
||||
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
if (!create_options) {
|
||||
ret = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue