提交 b0ed5e9f 编写于 作者: P Paolo Bonzini 提交者: Luiz Capitulino

qom: catch errors in object_property_add_child

Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
Tested-by: NIgor Mammedov <imammedo@redhat.com>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 28ec2598
......@@ -988,17 +988,22 @@ static void object_finalize_child_property(Object *obj, const char *name,
void object_property_add_child(Object *obj, const char *name,
Object *child, Error **errp)
{
Error *local_err = NULL;
gchar *type;
type = g_strdup_printf("child<%s>", object_get_typename(OBJECT(child)));
object_property_add(obj, name, type, object_get_child_property,
NULL, object_finalize_child_property, child, errp);
object_property_add(obj, name, type, object_get_child_property, NULL,
object_finalize_child_property, child, &local_err);
if (local_err) {
error_propagate(errp, local_err);
goto out;
}
object_ref(child);
g_assert(child->parent == NULL);
child->parent = obj;
out:
g_free(type);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册