aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c5
-rw-r--r--qom/object_interfaces.c23
2 files changed, 12 insertions, 16 deletions
diff --git a/qom/object.c b/qom/object.c
index 8e6e68d..3bc8a00 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -2036,10 +2036,9 @@ static void property_get_tm(Object *obj, Visitor *v, const char *name,
if (err) {
goto out_end;
}
+ visit_check_struct(v, &err);
out_end:
- error_propagate(errp, err);
- err = NULL;
- visit_end_struct(v, errp);
+ visit_end_struct(v);
out:
error_propagate(errp, err);
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index cad5542..51e62e2 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -42,7 +42,7 @@ Object *user_creatable_add(const QDict *qdict,
char *type = NULL;
char *id = NULL;
Object *obj = NULL;
- Error *local_err = NULL, *end_err = NULL;
+ Error *local_err = NULL;
QDict *pdict;
pdict = qdict_clone_shallow(qdict);
@@ -63,21 +63,15 @@ Object *user_creatable_add(const QDict *qdict,
if (local_err) {
goto out_visit;
}
-
- obj = user_creatable_add_type(type, id, pdict, v, &local_err);
+ visit_check_struct(v, &local_err);
if (local_err) {
goto out_visit;
}
- out_visit:
- visit_end_struct(v, &end_err);
- if (end_err) {
- error_propagate(&local_err, end_err);
- if (obj) {
- user_creatable_del(id, NULL);
- }
- goto out;
- }
+ obj = user_creatable_add_type(type, id, pdict, v, &local_err);
+
+out_visit:
+ visit_end_struct(v);
out:
QDECREF(pdict);
@@ -130,7 +124,10 @@ Object *user_creatable_add_type(const char *type, const char *id,
break;
}
}
- visit_end_struct(v, local_err ? NULL : &local_err);
+ if (!local_err) {
+ visit_check_struct(v, &local_err);
+ }
+ visit_end_struct(v);
if (local_err) {
goto out;
}