aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-09-14 15:42:22 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-09-15 14:11:49 +0200
commit64f7aece8ea0745c0990f7ba20189341e70f123c (patch)
tree15933cc4d1865557bb5a03af688947e9801fc59d /qom
parentf84698ee8b4a5d582b7f7080064198d70ba18f35 (diff)
object_initialize: try module load
Needed to allow virtio-gpu-pci initialize the virtio-gpu-device child device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200914134224.29769-5-kraxel@redhat.com
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index b1822a2ef4..387efb25eb 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();