diff options
author | Marc-André Lureau | 2020-01-10 16:30:19 +0100 |
---|---|---|
committer | Paolo Bonzini | 2020-01-24 20:59:12 +0100 |
commit | 2a1be4b34810c594b7f00e4b860df8d0c1cc6246 (patch) | |
tree | 5d8078d8b5a66eeecd78efaa8ddaa817182d4f32 /include/qom | |
parent | object: avoid extra class property key duplication (diff) | |
download | qemu-2a1be4b34810c594b7f00e4b860df8d0c1cc6246.tar.gz qemu-2a1be4b34810c594b7f00e4b860df8d0c1cc6246.tar.xz qemu-2a1be4b34810c594b7f00e4b860df8d0c1cc6246.zip |
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.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/qom/object.h b/include/qom/object.h index 54a548868c..29f47d3b35 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: |