diff options
author | Markus Armbruster | 2020-07-07 18:06:07 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-07-10 15:18:08 +0200 |
commit | b11a093c6025635b4504d79d30daa334a01279a5 (patch) | |
tree | ba15ee5016a149a5fc3d302417398cd585754f13 /hw/core/numa.c | |
parent | block/parallels: Simplify parallels_open() after previous commit (diff) | |
download | qemu-b11a093c6025635b4504d79d30daa334a01279a5.tar.gz qemu-b11a093c6025635b4504d79d30daa334a01279a5.tar.xz qemu-b11a093c6025635b4504d79d30daa334a01279a5.zip |
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>
Diffstat (limited to 'hw/core/numa.c')
-rw-r--r-- | hw/core/numa.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/core/numa.c b/hw/core/numa.c index 1b3267a607..d1a94a14f8 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -516,10 +516,10 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) Error *err = NULL; Visitor *v = opts_visitor_new(opts); - visit_type_NumaOptions(v, NULL, &object, &err); + visit_type_NumaOptions(v, NULL, &object, errp); visit_free(v); - if (err) { - goto end; + if (!object) { + return -1; } /* Fix up legacy suffix-less format */ @@ -530,7 +530,6 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) set_numa_options(ms, object, &err); -end: qapi_free_NumaOptions(object); if (err) { error_propagate(errp, err); |