@@ -521,20 +521,6 @@ const PropertyInfo prop_info_size32 = {
/* --- support for array properties --- */
-/* object property release callback for dynamically-created properties:
- * we call the underlying element's property release hook, and
- * then free the memory we allocated when we added the property.
- */
-static void static_prop_release_dynamic_prop(Object *obj, const char *name,
- void *opaque)
-{
- Property *prop = opaque;
- if (prop->info->release) {
- prop->info->release(obj, name, opaque);
- }
- g_free(prop);
-}
-
static void set_prop_arraylen(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp)
{
@@ -816,6 +802,21 @@ const PropertyInfo prop_info_link = {
.create = create_link_property,
};
+/*
+ * Property release callback for dynamically-created properties:
+ * We call the underlying element's property release hook, and
+ * then free the memory we allocated when we added the property.
+ */
+static void static_prop_release_dynamic_prop(Object *obj, const char *name,
+ void *opaque)
+{
+ Property *prop = opaque;
+ if (prop->info->release) {
+ prop->info->release(obj, name, opaque);
+ }
+ g_free(prop);
+}
+
ObjectProperty *
object_property_add_field(Object *obj, const char *name,
Property *prop,
Move the function closer to where it's used, to make refactor and review simpler. While doing it, reformat the comment at the top to follow coding style. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- This is a new patch added in v3 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 | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)