summaryrefslogtreecommitdiffstats
path: root/include/qom
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-05-05 18:29:00 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-06-05 17:36:39 +0200
commitfb9e7e334b54350e8e3b62bd7892b78f63a9d848 (patch)
treebadff9234c77d6ee7e0355b4c65bea2f4d742de6 /include/qom
parent3751d7c43f795b45ffdb9429cfb09c6beea55c68 (diff)
downloadhqemu-fb9e7e334b54350e8e3b62bd7892b78f63a9d848.zip
hqemu-fb9e7e334b54350e8e3b62bd7892b78f63a9d848.tar.gz
qom: add object_property_add_const_link
Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qom')
-rw-r--r--include/qom/object.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index d2d7748..0505f20 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1290,6 +1290,24 @@ void object_property_add_alias(Object *obj, const char *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<TYPE> 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
* @name: the name of the property
OpenPOWER on IntegriCloud