aboutsummaryrefslogtreecommitdiff
path: root/include/qom
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-10 19:30:19 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-01-24 20:59:12 +0100
commit2a1be4b34810c594b7f00e4b860df8d0c1cc6246 (patch)
tree5d8078d8b5a66eeecd78efaa8ddaa817182d4f32 /include/qom
parentba806ffbdf11a63993e4b5d64cca085d385dc1bc (diff)
downloadqemu-2a1be4b34810c594b7f00e4b860df8d0c1cc6246.zip
qemu-2a1be4b34810c594b7f00e4b860df8d0c1cc6246.tar.gz
qemu-2a1be4b34810c594b7f00e4b860df8d0c1cc6246.tar.bz2
object: add class property initializer
This callback is used to set default value in following patch "object: add object_property_set_defaut_{bool,str,int,uint}()". Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-7-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qom')
-rw-r--r--include/qom/object.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index 54a5488..29f47d3 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -309,6 +309,8 @@ typedef struct InterfaceInfo InterfaceInfo;
*/
+typedef struct ObjectProperty ObjectProperty;
+
/**
* ObjectPropertyAccessor:
* @obj: the object that owns the property
@@ -356,7 +358,16 @@ typedef void (ObjectPropertyRelease)(Object *obj,
const char *name,
void *opaque);
-typedef struct ObjectProperty
+/**
+ * ObjectPropertyInit:
+ * @obj: the object that owns the property
+ * @prop: the property to set
+ *
+ * Called when a property is initialized.
+ */
+typedef void (ObjectPropertyInit)(Object *obj, ObjectProperty *prop);
+
+struct ObjectProperty
{
gchar *name;
gchar *type;
@@ -365,8 +376,9 @@ typedef struct ObjectProperty
ObjectPropertyAccessor *set;
ObjectPropertyResolve *resolve;
ObjectPropertyRelease *release;
+ ObjectPropertyInit *init;
void *opaque;
-} ObjectProperty;
+};
/**
* ObjectUnparent: