From 23a1dae8c16e7e9e728dc8ae2daaece974bd7d01 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Fri, 11 Dec 2020 17:05:17 -0500 Subject: 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 Message-Id: <20201211220529.2290218-21-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'hw/core/qdev-properties.c') 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); } } -- cgit v1.2.3-55-g7522