qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]