aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-02-02 10:51:57 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-02-07 13:52:41 +0100
commit1d9c5a12cefcd914d99c32de9aac72966a4788ae (patch)
tree586b68028e04ca7cf3cb3a95fec94a3024f0384a /include
parenta1e7efdcef38f7cba4a46e836f433c73d45d926f (diff)
qom: add property get/set wrappers for links
These can set a link to any object, as long as it is included in the composition tree. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/qemu/object.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/qemu/object.h b/include/qemu/object.h
index 6c36345814..7d50da9078 100644
--- a/include/qemu/object.h
+++ b/include/qemu/object.h
@@ -646,6 +646,30 @@ char *object_property_get_str(Object *obj, const char *name,
struct Error **errp);
/**
+ * object_property_set_link:
+ * @value: the value to be written to the property
+ * @name: the name of the property
+ * @errp: returns an error if this function fails
+ *
+ * Writes an object's canonical path to a property.
+ */
+void object_property_set_link(Object *obj, Object *value,
+ const char *name, struct Error **errp);
+
+/**
+ * object_property_get_link:
+ * @obj: the object
+ * @name: the name of the property
+ * @errp: returns an error if this function fails
+ *
+ * Returns: the value of the property, resolved from a path to an Object,
+ * or NULL if an error occurs (including when the property value is not a
+ * string or not a valid object path).
+ */
+Object *object_property_get_link(Object *obj, const char *name,
+ struct Error **errp);
+
+/**
* object_property_set_bool:
* @value: the value to be written to the property
* @name: the name of the property