aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/core/qdev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2131c7f951..9de16eae05 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -137,6 +137,9 @@ void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
*/
DeviceState *qdev_new(const char *name)
{
+ if (!object_class_by_name(name)) {
+ module_load_qom_one(name);
+ }
return DEVICE(object_new(name));
}
@@ -147,10 +150,9 @@ DeviceState *qdev_new(const char *name)
*/
DeviceState *qdev_try_new(const char *name)
{
- if (!object_class_by_name(name)) {
+ if (!module_object_class_by_name(name)) {
return NULL;
}
-
return DEVICE(object_new(name));
}