]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
qdev: Add name argument to PropertyInfo.create method
authorEduardo Habkost <ehabkost@redhat.com>
Fri, 11 Dec 2020 22:05:18 +0000 (17:05 -0500)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 18 Dec 2020 20:20:17 +0000 (15:20 -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
include/hw/qdev-properties.h

index 457c7fe4ba2e91774c1594103cf0ad61765dba14..c68a20695d6d20dfceda798718f9a4ef20f671a3 100644 (file)
@@ -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;
 
index 476737b9da8475aecd55b1b0f2e75abe7b56bdae..ab9c538ba499fcbd30689c2d83efbde2002617b6 100644 (file)
@@ -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;