mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -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
|
@ -85,21 +85,18 @@ static void nvdimm_set_uuid(Object *obj, Visitor *v, const char *name,
|
|||
void *opaque, Error **errp)
|
||||
{
|
||||
NVDIMMDevice *nvdimm = NVDIMM(obj);
|
||||
Error *local_err = NULL;
|
||||
char *value;
|
||||
|
||||
if (!visit_type_str(v, name, &value, &local_err)) {
|
||||
goto out;
|
||||
if (!visit_type_str(v, name, &value, errp)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (qemu_uuid_parse(value, &nvdimm->uuid) != 0) {
|
||||
error_setg(errp, "Property '%s.%s' has invalid value",
|
||||
object_get_typename(obj), name);
|
||||
}
|
||||
g_free(value);
|
||||
|
||||
out:
|
||||
error_propagate(errp, local_err);
|
||||
g_free(value);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue