mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
ba806ffbdf
commit
2a1be4b348
2 changed files with 28 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue