qom: print out type name on lookup failure

Message ID 1518538727-952-1-git-send-email-mst@redhat.com
State New
Headers show
Series
  • qom: print out type name on lookup failure
Related show

Commit Message

Michael S. Tsirkin Feb. 13, 2018, 4:18 p.m.
this makes debugging a bit easier.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 qom/object.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/qom/object.c b/qom/object.c
index c58c52d..a1e5f99 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -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);
 }