aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/qom/object.c b/qom/object.c
index aba942bdf3..e25f1e96db 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -526,8 +526,13 @@ void object_initialize(void *data, size_t size, const char *typename)
#ifdef CONFIG_MODULES
if (!type) {
- module_load_qom(typename);
- type = type_get_by_name(typename);
+ int rv = module_load_qom(typename, &error_fatal);
+ if (rv > 0) {
+ type = type_get_by_name(typename);
+ } else {
+ error_report("missing object type '%s'", typename);
+ exit(1);
+ }
}
#endif
if (!type) {
@@ -1033,8 +1038,13 @@ ObjectClass *module_object_class_by_name(const char *typename)
oc = object_class_by_name(typename);
#ifdef CONFIG_MODULES
if (!oc) {
- module_load_qom(typename);
- oc = object_class_by_name(typename);
+ Error *local_err = NULL;
+ int rv = module_load_qom(typename, &local_err);
+ if (rv > 0) {
+ oc = object_class_by_name(typename);
+ } else if (rv < 0) {
+ error_report_err(local_err);
+ }
}
#endif
return oc;