mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
qdev: make compat stuff more generic
This patch renames the compat properties into global properties and makes them more generic. The compatibility stuff is only one of multiple possible users now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
4d6e3ac5d4
commit
458fb6792d
6 changed files with 24 additions and 16 deletions
|
@ -593,21 +593,27 @@ void qdev_prop_set_defaults(DeviceState *dev, Property *props)
|
|||
}
|
||||
}
|
||||
|
||||
static CompatProperty *compat_props;
|
||||
static QTAILQ_HEAD(, GlobalProperty) global_props = QTAILQ_HEAD_INITIALIZER(global_props);
|
||||
|
||||
void qdev_prop_register_compat(CompatProperty *props)
|
||||
void qdev_prop_register_global(GlobalProperty *prop)
|
||||
{
|
||||
compat_props = props;
|
||||
QTAILQ_INSERT_TAIL(&global_props, prop, next);
|
||||
}
|
||||
|
||||
void qdev_prop_set_compat(DeviceState *dev)
|
||||
void qdev_prop_register_global_list(GlobalProperty *props)
|
||||
{
|
||||
CompatProperty *prop;
|
||||
int i;
|
||||
|
||||
if (!compat_props) {
|
||||
return;
|
||||
for (i = 0; props[i].driver != NULL; i++) {
|
||||
qdev_prop_register_global(props+i);
|
||||
}
|
||||
for (prop = compat_props; prop->driver != NULL; prop++) {
|
||||
}
|
||||
|
||||
void qdev_prop_set_globals(DeviceState *dev)
|
||||
{
|
||||
GlobalProperty *prop;
|
||||
|
||||
QTAILQ_FOREACH(prop, &global_props, next) {
|
||||
if (strcmp(dev->info->name, prop->driver) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue