diff mbox series

[v3,36/53] qdev: Don't set .name_template for array elements

Message ID 20201112214350.872250-37-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show
Series Make qdev static property API usable by any QOM type | expand

Commit Message

Eduardo Habkost Nov. 12, 2020, 9:43 p.m. UTC
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 mbox series

Patch

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