* [Qemu-devel] [PATCH] exit qemu when unknown object type is specified by -object
@ 2014-04-11 3:59 Hu Tao
0 siblings, 0 replies; only message in thread
From: Hu Tao @ 2014-04-11 3:59 UTC (permalink / raw)
To: qemu-devel
...to avoid assertion failure in object_new_with_type(). Can be
reproduced by: qemu -object unknown-object,id=xxx
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-11 4:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-11 3:59 [Qemu-devel] [PATCH] exit qemu when unknown object type is specified by -object Hu Tao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).