diff mbox series

[1/3] object_initialize: try module load

Message ID 20200907094719.12850-1-kraxel@redhat.com
State New
Headers show
Series [1/3] object_initialize: try module load | expand

Commit Message

Gerd Hoffmann Sept. 7, 2020, 9:47 a.m. UTC
Needed to allow virtio-gpu-pci initialize the
virtio-gpu-device child device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 qom/object.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/qom/object.c b/qom/object.c
index 00fdf89b3b0a..f85740001520 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -518,6 +518,12 @@  void object_initialize(void *data, size_t size, const char *typename)
 {
     TypeImpl *type = type_get_by_name(typename);
 
+#ifdef CONFIG_MODULES
+    if (!type) {
+        module_load_qom_one(typename);
+        type = type_get_by_name(typename);
+    }
+#endif
     if (!type) {
         error_report("missing object type '%s'", typename);
         abort();