diff mbox series

[v2,31/44] qdev: Reuse object_property_add_field() when adding array elements

Message ID 20201104160021.2342108-32-ehabkost@redhat.com
State New
Headers show
Series Make qdev static property API usable by any QOM type | expand

Commit Message

Eduardo Habkost Nov. 4, 2020, 4 p.m. UTC
Now that we can call object_property_add() with exactly the same
arguments as object_property_add_field(), we can just reuse the
function.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* Now we don't need to hack ObjectProperty.release anymore,
  patch became trivial
---
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 | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 0aa482b3ab..5faf974c4f 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -574,12 +574,7 @@  static void set_prop_arraylen(Object *obj, Visitor *v, const char *name,
          */
         arrayprop->offset = eltptr - (void *)obj;
         assert(qdev_get_prop_ptr(obj, arrayprop) == eltptr);
-        object_property_add(obj, propname,
-                            arrayprop->info->name,
-                            field_prop_getter(arrayprop->info),
-                            field_prop_setter(arrayprop->info),
-                            arrayprop->info->release,
-                            arrayprop);
+        object_property_add_field(obj, propname, arrayprop);
     }
 }