[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/15] qdev: Add name argument to PropertyInfo.create method
From: |
Eduardo Habkost |
Subject: |
[PULL 07/15] qdev: Add name argument to PropertyInfo.create method |
Date: |
Wed, 23 Dec 2020 16:27:27 -0500 |
This will make it easier to remove the Property.name field in the
future.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20201211220529.2290218-22-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
hw/core/qdev-properties.c | 7 ++++---
include/hw/qdev-properties.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 457c7fe4ba..c68a20695d 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -851,9 +851,10 @@ const PropertyInfo qdev_prop_size = {
/* --- object link property --- */
-static void create_link_property(ObjectClass *oc, Property *prop)
+static void create_link_property(ObjectClass *oc, const char *name,
+ Property *prop)
{
- object_class_property_add_link(oc, prop->name, prop->link_type,
+ object_class_property_add_link(oc, name, prop->link_type,
prop->offset,
qdev_prop_allow_set_link_before_realize,
OBJ_PROP_LINK_STRONG);
@@ -893,7 +894,7 @@ static void qdev_class_add_property(DeviceClass *klass,
const char *name,
ObjectClass *oc = OBJECT_CLASS(klass);
if (prop->info->create) {
- prop->info->create(oc, prop);
+ prop->info->create(oc, name, prop);
} else {
ObjectProperty *op;
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 476737b9da..ab9c538ba4 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -34,7 +34,7 @@ struct PropertyInfo {
const QEnumLookup *enum_table;
int (*print)(Object *obj, Property *prop, char *dest, size_t len);
void (*set_default_value)(ObjectProperty *op, const Property *prop);
- void (*create)(ObjectClass *oc, Property *prop);
+ void (*create)(ObjectClass *oc, const char *name, Property *prop);
ObjectPropertyAccessor *get;
ObjectPropertyAccessor *set;
ObjectPropertyRelease *release;
--
2.28.0
- [PULL 00/15] Machine queue, 2020-12-23, Eduardo Habkost, 2020/12/23
- [PULL 03/15] sparc: Use DEFINE_PROP for nwindows property, Eduardo Habkost, 2020/12/23
- [PULL 01/15] qdev: Move softmmu properties to qdev-properties-system.h, Eduardo Habkost, 2020/12/23
- [PULL 02/15] qdev: Reuse DEFINE_PROP in all DEFINE_PROP_* macros, Eduardo Habkost, 2020/12/23
- [PULL 04/15] qdev: Get just property name at error_set_from_qdev_prop_error(), Eduardo Habkost, 2020/12/23
- [PULL 05/15] qdev: Avoid using prop->name unnecessarily, Eduardo Habkost, 2020/12/23
- [PULL 06/15] qdev: Add name parameter to qdev_class_add_property(), Eduardo Habkost, 2020/12/23
- [PULL 07/15] qdev: Add name argument to PropertyInfo.create method,
Eduardo Habkost <=
- [PULL 08/15] qdev: Wrap getters and setters in separate helpers, Eduardo Habkost, 2020/12/23
- [PULL 09/15] qdev: Move dev->realized check to qdev_property_set(), Eduardo Habkost, 2020/12/23
- [PULL 11/15] qdev: Make qdev_class_add_property() more flexible, Eduardo Habkost, 2020/12/23
- [PULL 10/15] qdev: Make PropertyInfo.create return ObjectProperty*, Eduardo Habkost, 2020/12/23
- [PULL 12/15] qdev: Move qdev_prop_tpm declaration to tpm_prop.h, Eduardo Habkost, 2020/12/23
- [PULL 13/15] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr(), Eduardo Habkost, 2020/12/23
- [PULL 14/15] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen(), Eduardo Habkost, 2020/12/23
- [PULL 15/15] bugfix: hostmem: Free host_nodes list right after visited, Eduardo Habkost, 2020/12/23