qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] exit qemu when unknown object type is specified by


From: Hu Tao
Subject: [Qemu-devel] [PATCH] exit qemu when unknown object type is specified by -object
Date: Fri, 11 Apr 2014 11:59:14 +0800

...to avoid assertion failure in object_new_with_type(). Can be
reproduced by: qemu -object unknown-object,id=xxx

Signed-off-by: Hu Tao <address@hidden>
---
 qom/object.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/qom/object.c b/qom/object.c
index f4de619..1e7445b 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -448,6 +448,11 @@ Object *object_new(const char *typename)
 {
     TypeImpl *ti = type_get_by_name(typename);
 
+    if (!ti) {
+        error_report("unknown object type: %s\n", typename);
+        exit(1);
+    }
+
     return object_new_with_type(ti);
 }
 
-- 
1.8.5.2.229.g4448466




reply via email to

[Prev in Thread] Current Thread [Next in Thread]