summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarkus Armbruster2020-07-07 18:05:47 +0200
committerMarkus Armbruster2020-07-10 15:18:08 +0200
commit14217038bc9e36246d311fa8e026a01a5d7bbd42 (patch)
treec93af897bda7a8789e91d09eb89a035bbe4bcff0 /net
parentqapi: Use returned bool to check for failure, Coccinelle part (diff)
downloadqemu-14217038bc9e36246d311fa8e026a01a5d7bbd42.tar.gz
qemu-14217038bc9e36246d311fa8e026a01a5d7bbd42.tar.xz
qemu-14217038bc9e36246d311fa8e026a01a5d7bbd42.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/net.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/net.c b/net/net.c
index 94dc546fb2..6fe74c80bb 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1062,7 +1062,6 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
{
gchar **substrings = NULL;
Netdev *object = NULL;
- Error *err = NULL;
int ret = -1;
Visitor *v = opts_visitor_new(opts);
@@ -1110,16 +1109,13 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
qemu_opts_set_id(opts, g_strdup_printf("__org.qemu.net%i", idx++));
}
- visit_type_Netdev(v, NULL, &object, &err);
-
- if (!err) {
- ret = net_client_init1(object, is_netdev, &err);
+ if (visit_type_Netdev(v, NULL, &object, errp)) {
+ ret = net_client_init1(object, is_netdev, errp);
}
qapi_free_Netdev(object);
out:
- error_propagate(errp, err);
g_strfreev(substrings);
visit_free(v);
return ret;