aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-12-11 17:05:17 -0500
committerEduardo Habkost <ehabkost@redhat.com>2020-12-18 15:20:17 -0500
commit23a1dae8c16e7e9e728dc8ae2daaece974bd7d01 (patch)
tree8510afe36abd72be923e9bd4264d3d95c9094970 /hw/core
parent991f0ac90151fe1bf51a1630938041a5c5745fb9 (diff)
qdev: Add name parameter to qdev_class_add_property()
This will make it easier to remove Property.name in the future. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20201211220529.2290218-21-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev-properties.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 50734a1cd4..457c7fe4ba 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -887,7 +887,8 @@ void qdev_property_add_static(DeviceState *dev, Property *prop)
}
}
-static void qdev_class_add_property(DeviceClass *klass, Property *prop)
+static void qdev_class_add_property(DeviceClass *klass, const char *name,
+ Property *prop)
{
ObjectClass *oc = OBJECT_CLASS(klass);
@@ -897,7 +898,7 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
ObjectProperty *op;
op = object_class_property_add(oc,
- prop->name, prop->info->name,
+ name, prop->info->name,
prop->info->get, prop->info->set,
prop->info->release,
prop);
@@ -905,7 +906,7 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
prop->info->set_default_value(op, prop);
}
}
- object_class_property_set_description(oc, prop->name,
+ object_class_property_set_description(oc, name,
prop->info->description);
}
@@ -962,7 +963,7 @@ void device_class_set_props(DeviceClass *dc, Property *props)
dc->props_ = props;
for (prop = props; prop && prop->name; prop++) {
qdev_class_add_legacy_property(dc, prop);
- qdev_class_add_property(dc, prop);
+ qdev_class_add_property(dc, prop->name, prop);
}
}