提交 69252c04 编写于 作者: I Igor Mammedov 提交者: Luiz Capitulino

object_add: consolidate error handling

Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册