[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 36/53] qdev: Don't set .name_template for array elements
From: |
Eduardo Habkost |
Subject: |
[PATCH v3 36/53] qdev: Don't set .name_template for array elements |
Date: |
Thu, 12 Nov 2020 16:43:33 -0500 |
All property code should be able to handle .name_template==NULL
without problems, so we don't need to set it for array elements.
This simple change will allow us to simplify the array property
registration code a lot in the next commits.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
This is a patch added in v2 of the series
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 03cfad1e74..ad08c80e67 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -593,7 +593,6 @@ static void set_prop_arraylen(Object *obj, Visitor *v,
const char *name,
arrayprop->release = prop->arrayinfo->release;
arrayprop->propname = propname;
arrayprop->prop.info = prop->arrayinfo;
- arrayprop->prop.name_template = propname;
/* This ugly piece of pointer arithmetic sets up the offset so
* that when the underlying get/set hooks call qdev_get_prop_ptr
* they get the right answer despite the array element not actually
--
2.28.0
- [PATCH v3 25/53] qdev: Make qdev_class_add_property() more flexible, (continued)
- [PATCH v3 25/53] qdev: Make qdev_class_add_property() more flexible, Eduardo Habkost, 2020/11/12
- [PATCH v3 26/53] qdev: Separate generic and device-specific property registration, Eduardo Habkost, 2020/11/12
- [PATCH v3 27/53] qdev: Rename qdev_propinfo_* to field_prop_*, Eduardo Habkost, 2020/11/12
- [PATCH v3 28/53] qdev: Move qdev_prop_tpm declaration to tpm_prop.h, Eduardo Habkost, 2020/11/12
- [PATCH v3 29/53] qdev: Rename qdev_prop_* to prop_info_*, Eduardo Habkost, 2020/11/12
- [PATCH v3 30/53] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr(), Eduardo Habkost, 2020/11/12
- [PATCH v3 31/53] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen(), Eduardo Habkost, 2020/11/12
- [PATCH v3 32/53] tests: Add unit test for qdev array properties, Eduardo Habkost, 2020/11/12
- [PATCH v3 33/53] qom: Add allow_set callback to ObjectProperty, Eduardo Habkost, 2020/11/12
- [PATCH v3 34/53] qdev: Make qdev_prop_allow_set() a ObjectProperty.allow_set callback, Eduardo Habkost, 2020/11/12
- [PATCH v3 36/53] qdev: Don't set .name_template for array elements,
Eduardo Habkost <=
- [PATCH v3 35/53] qdev: Rename Property.name to Property.name_template, Eduardo Habkost, 2020/11/12
- [PATCH v3 37/53] qdev: Remove ArrayElementProperty.propname field, Eduardo Habkost, 2020/11/12
- [PATCH v3 38/53] qdev: Remove ArrayElementProperty.release field, Eduardo Habkost, 2020/11/12
- [PATCH v3 39/53] qdev: Get rid of ArrayElementProperty struct, Eduardo Habkost, 2020/11/12
- [PATCH v3 40/53] qdev: Rename array_element_release() to static_prop_release_dynamic_prop(), Eduardo Habkost, 2020/11/12
- [PATCH v3 41/53] qdev: Make object_property_add_field() copy the Property struct, Eduardo Habkost, 2020/11/12
- [PATCH v3 44/53] qom: Add new qom.h header, Eduardo Habkost, 2020/11/12
- [PATCH v3 43/53] qdev: Move static_prop_release_dynamic_prop() closer to its usage, Eduardo Habkost, 2020/11/12
- [PATCH v3 42/53] qdev: Reuse object_property_add_field() when adding array elements, Eduardo Habkost, 2020/11/12
- [PATCH v3 45/53] qdev: Move core field property code to QOM, Eduardo Habkost, 2020/11/12