diff mbox series

[v2,4/5] qom: Convert alias properties to QAPI-aware registration

Message ID 20261105080310.1656968-5-armbru@redhat.com
State New
Headers show
Series qom/qdev: associate properties with QAPI types fixups | expand

Commit Message

Markus Armbruster Nov. 5, 2026, 8:03 a.m. UTC
Pass the target property's QAPITypeInfo to object_class_property_add()
/ object_property_add().

Commit 53c674710b4 (qom: add qapi_type field to ObjectProperty)
already monkey-patched it in object_property_add_alias(), but not in
object_class_property_add_alias().  Delete that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qom/object.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/qom/object.c b/qom/object.c
index cd0590c3fd..774a976c8b 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -3099,13 +3099,13 @@  object_property_add_alias(Object *obj, const char *name,
     prop->target_name = g_strdup(target_name);
     prop->flags = 0;
 
-    op = object_property_add(obj, name, prop_type, NULL,
+    op = object_property_add(obj, name, prop_type,
+                             target_prop->qapi_type,
                              property_get_alias,
                              property_set_alias,
                              property_release_alias,
                              prop);
     op->resolve = property_resolve_alias;
-    op->qapi_type = target_prop->qapi_type;
     if (target_prop->defval) {
         op->defval = qobject_ref(target_prop->defval);
     }
@@ -3144,7 +3144,8 @@  object_class_property_add_alias(ObjectClass *klass, const char *name,
     prop->target_name = g_strdup(target_name);
     prop->flags = OBJ_PROP_ALIAS_CLASS;
 
-    op = object_class_property_add(klass, name, prop_type, NULL,
+    op = object_class_property_add(klass, name, prop_type,
+                                   target_prop->qapi_type,
                                    property_get_alias,
                                    property_set_alias,
                                    property_release_alias,