From fb9e7e334b54350e8e3b62bd7892b78f63a9d848 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 5 May 2015 18:29:00 +0200 Subject: qom: add object_property_add_const_link Suggested-by: Eduardo Habkost Signed-off-by: Paolo Bonzini --- include/qom/object.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/qom/object.h') diff --git a/include/qom/object.h b/include/qom/object.h index d2d7748f62..0505f20e71 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -1289,6 +1289,24 @@ void object_property_add_alias(Object *obj, const char *name, Object *target_obj, const char *target_name, Error **errp); +/** + * object_property_add_const_link: + * @obj: the object to add a property to + * @name: the name of the property + * @target: the object to be referred by the link + * @errp: if an error occurs, a pointer to an area to store the error + * + * Add an unmodifiable link for a property on an object. This function will + * add a property of type link where TYPE is the type of @target. + * + * The caller must ensure that @target stays alive as long as + * this property exists. In the case @target is a child of @obj, + * this will be the case. Otherwise, the caller is responsible for + * taking a reference. + */ +void object_property_add_const_link(Object *obj, const char *name, + Object *target, Error **errp); + /** * object_property_set_description: * @obj: the object owning the property -- cgit v1.2.3