mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
qdev: Move property code to qdev-properties.[ch]
Move everything related to Property and PropertyInfo to qdev-properties.[ch] to make it easier to refactor that code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201211220529.2290218-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
@ -276,43 +276,6 @@ struct BusState {
|
||||
ResettableState reset;
|
||||
};
|
||||
|
||||
/**
|
||||
* Property:
|
||||
* @set_default: true if the default value should be set from @defval,
|
||||
* in which case @info->set_default_value must not be NULL
|
||||
* (if false then no default value is set by the property system
|
||||
* and the field retains whatever value it was given by instance_init).
|
||||
* @defval: default value for the property. This is used only if @set_default
|
||||
* is true.
|
||||
*/
|
||||
struct Property {
|
||||
const char *name;
|
||||
const PropertyInfo *info;
|
||||
ptrdiff_t offset;
|
||||
uint8_t bitnr;
|
||||
bool set_default;
|
||||
union {
|
||||
int64_t i;
|
||||
uint64_t u;
|
||||
} defval;
|
||||
int arrayoffset;
|
||||
const PropertyInfo *arrayinfo;
|
||||
int arrayfieldsize;
|
||||
const char *link_type;
|
||||
};
|
||||
|
||||
struct PropertyInfo {
|
||||
const char *name;
|
||||
const char *description;
|
||||
const QEnumLookup *enum_table;
|
||||
int (*print)(DeviceState *dev, Property *prop, char *dest, size_t len);
|
||||
void (*set_default_value)(ObjectProperty *op, const Property *prop);
|
||||
void (*create)(ObjectClass *oc, Property *prop);
|
||||
ObjectPropertyAccessor *get;
|
||||
ObjectPropertyAccessor *set;
|
||||
ObjectPropertyRelease *release;
|
||||
};
|
||||
|
||||
/**
|
||||
* GlobalProperty:
|
||||
* @used: Set to true if property was used when initializing a device.
|
||||
|
Reference in New Issue
Block a user