aboutsummaryrefslogtreecommitdiff
path: root/qom/object.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.c
parentee8a1c63d337a893fa915dd263dfdaa272e1a76a (diff)
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.c')
-rw-r--r--qom/object.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/qom/object.c b/qom/object.c
index e86cb05b84..6be710bc40 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1389,7 +1389,7 @@ bool object_property_get(Object *obj, const char *name, Visitor *v,
bool object_property_set(Object *obj, const char *name, Visitor *v,
Error **errp)
{
- Error *err = NULL;
+ ERRP_GUARD();
ObjectProperty *prop = object_property_find_err(obj, name, errp);
if (prop == NULL) {
@@ -1400,9 +1400,8 @@ bool object_property_set(Object *obj, const char *name, Visitor *v,
error_setg(errp, QERR_PERMISSION_DENIED);
return false;
}
- prop->set(obj, v, name, prop->opaque, &err);
- error_propagate(errp, err);
- return !err;
+ prop->set(obj, v, name, prop->opaque, errp);
+ return !*errp;
}
bool object_property_set_str(Object *obj, const char *name,