Skip to contentSkip to conversation

qom: print out type name on lookup failure

PATCH New Michael S. Tsirkin 1 participant 1 message Feb 13, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qom: print out type name on lookup failure

this makes debugging a bit easier.

---
 qom/object.c | 4 ++++
 1 file changed, 4 insertions(+)
qom/object.c +4 -0
index c58c52d..a1e5f99 100644
@@ -499,6 +499,10 @@ Object *object_new(const char *typename)
 {
     TypeImpl *ti = type_get_by_name(typename);
 
+    if (!ti) {
+        g_error("Object type not found: %s\n", typename);
+    }
+
     return object_new_with_type(ti);
 }
 
Signature · 1 line
MST