From e732ea638705da35445a42dee32691fbe813d3e0 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sun, 22 Sep 2013 10:10:17 +0300 Subject: 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 Reviewed-by: Gerd Hoffmann Tested-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Tested-by: Igor Mammedov Signed-off-by: Michael S. Tsirkin --- include/qom/object.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/qom') diff --git a/include/qom/object.h b/include/qom/object.h index 6c1e7d32e..d02172adc 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -794,6 +794,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 -- cgit v1.2.3