summary refs log tree commit diff stats
path: root/qom/object_interfaces.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-10-29 10:45:51 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2024-10-31 18:28:32 +0100
commitb801e3cb2a7fd631a219222a8cbe9d554c906070 (patch)
tree6ac9a4df0938700c017b91196f971a667aeef24f /qom/object_interfaces.c
parent845b54efafa5c28040570dcb6d7f8f84d23e37f3 (diff)
downloadfocaccia-qemu-b801e3cb2a7fd631a219222a8cbe9d554c906070.tar.gz
focaccia-qemu-b801e3cb2a7fd631a219222a8cbe9d554c906070.zip
qom: use object_new_with_class when possible
A small optimization/code simplification, that also makes it clear that
we won't look for a type in a not-loaded-yet module---the module will
have been loaded by a call to module_object_class_by_name(), if present.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qom/object_interfaces.c')
-rw-r--r--qom/object_interfaces.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index e0833c8bfe..1f2aa13306 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -108,7 +108,7 @@ Object *user_creatable_add_type(const char *type, const char *id,
     }
 
     assert(qdict);
-    obj = object_new(type);
+    obj = object_new_with_class(klass);
     object_set_properties_from_qdict(obj, qdict, v, &local_err);
     if (local_err) {
         goto out;