aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-09-22 10:10:17 +0300
committerMichael S. Tsirkin <mst@redhat.com>2013-10-14 17:46:00 +0300
commite732ea638705da35445a42dee32691fbe813d3e0 (patch)
tree0c28353ccd55404a1d056172411c36c74f629e99 /include
parente82df24873970742778e4a960f059ba9f8b1b2a7 (diff)
downloadqemu-e732ea638705da35445a42dee32691fbe813d3e0.zip
qemu-e732ea638705da35445a42dee32691fbe813d3e0.tar.gz
qemu-e732ea638705da35445a42dee32691fbe813d3e0.tar.bz2
qom: add pointer to int property helpers
Make it easy to add read-only helpers for simple integer properties in memory. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Tested-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/qom/object.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index 6c1e7d3..d02172a 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -795,6 +795,27 @@ void object_property_add(Object *obj, const char *name, const char *type,
void object_property_del(Object *obj, const char *name, Error **errp);
/**
+ * object_property_add_uint8_ptr:
+ * object_property_add_uint16_ptr:
+ * object_property_add_uint32_ptr:
+ * object_property_add_uint64_ptr:
+ * @obj: the object to add a property to
+ * @name: the name of the property
+ * @v: pointer to value
+ *
+ * Add an integer property in memory. This function will add a
+ * property of the appropriate type.
+ */
+void object_property_add_uint8_ptr(Object *obj, const char *name,
+ const uint8_t *v, Error **errp);
+void object_property_add_uint16_ptr(Object *obj, const char *name,
+ const uint16_t *v, Error **errp);
+void object_property_add_uint32_ptr(Object *obj, const char *name,
+ const uint32_t *v, Error **errp);
+void object_property_add_uint64_ptr(Object *obj, const char *name,
+ const uint64_t *v, Error **Errp);
+
+/**
* object_property_find:
* @obj: the object
* @name: the name of the property