Commit 69252c04 authored by Igor Mammedov's avatar Igor Mammedov Committed by Luiz Capitulino

object_add: consolidate error handling

Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
parent 0169c511
......@@ -549,15 +549,17 @@ void object_add(const char *type, const char *id, const QDict *qdict,
for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) {
object_property_set(obj, v, e->key, &local_err);
if (local_err) {
error_propagate(errp, local_err);
object_unref(obj);
return;
goto out;
}
}
}
object_property_add_child(container_get(object_get_root(), "/objects"),
id, obj, errp);
id, obj, &local_err);
out:
if (local_err) {
error_propagate(errp, local_err);
}
object_unref(obj);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment