aboutsummaryrefslogtreecommitdiff
path: root/qom/object_interfaces.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2021-10-08 15:34:31 +0200
committerKevin Wolf <kwolf@redhat.com>2021-10-15 16:06:11 +0200
commitdbc8221f8cf3a3004fb6b4d0675f5852758b0388 (patch)
treeba5c94d3ace0d93a75da5e4faf02c4a2c7a505a6 /qom/object_interfaces.c
parentee8a1c63d337a893fa915dd263dfdaa272e1a76a (diff)
downloadqemu-dbc8221f8cf3a3004fb6b4d0675f5852758b0388.zip
qemu-dbc8221f8cf3a3004fb6b4d0675f5852758b0388.tar.gz
qemu-dbc8221f8cf3a3004fb6b4d0675f5852758b0388.tar.bz2
qom: Reduce use of error_propagate()
ERRP_GUARD() makes debugging easier by making sure that &error_abort still fails at the real origin of the error instead of error_propagate(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20211008133442.141332-5-kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qom/object_interfaces.c')
-rw-r--r--qom/object_interfaces.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index ad9b56b..3b61c19 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -46,25 +46,18 @@ static void object_set_properties_from_qdict(Object *obj, const QDict *qdict,
Visitor *v, Error **errp)
{
const QDictEntry *e;
- Error *local_err = NULL;
- if (!visit_start_struct(v, NULL, NULL, 0, &local_err)) {
- goto out;
+ if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
+ return;
}
for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) {
- if (!object_property_set(obj, e->key, v, &local_err)) {
- break;
+ if (!object_property_set(obj, e->key, v, errp)) {
+ goto out;
}
}
- if (!local_err) {
- visit_check_struct(v, &local_err);
- }
- visit_end_struct(v, NULL);
-
+ visit_check_struct(v, errp);
out:
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ visit_end_struct(v, NULL);
}
void object_set_properties_from_keyval(Object *obj, const QDict *qdict,