summary refs log tree commit diff stats
path: root/qom/object.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-10-29 10:41:58 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2024-10-31 18:28:32 +0100
commit02009a12bcd7927a968df7641eaa609b659b3470 (patch)
treeb8075f8edf7124686c666393af194a54020aa845 /qom/object.c
parent144d80f69e9ee614bf7fb06ad586cef610cec0f7 (diff)
downloadfocaccia-qemu-02009a12bcd7927a968df7641eaa609b659b3470.tar.gz
focaccia-qemu-02009a12bcd7927a968df7641eaa609b659b3470.zip
qom: let object_new use a module if the type is not present
object_initialize() can use modules (it was added there because
virtio-gpu-device is a child device of virtio-gpu-pci; commit
64f7aece8ea, "object_initialize: try module load", 2020-09-15).
object_new() cannot; make things consistent.

qdev_new() is now just a simple wrapper that returns DeviceState.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qom/object.c')
-rw-r--r--qom/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qom/object.c b/qom/object.c
index 29155c6463..9edc06d391 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -790,7 +790,7 @@ Object *object_new_with_class(ObjectClass *klass)
 
 Object *object_new(const char *typename)
 {
-    TypeImpl *ti = type_get_by_name_noload(typename);
+    TypeImpl *ti = type_get_or_load_by_name(typename, &error_fatal);
 
     return object_new_with_type(ti);
 }