qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/qdev-monitor: report error for -device <not-a-device-type>
@ 2012-11-28  8:54 Alon Levy
  2012-11-28 11:54 ` Luiz Capitulino
  2012-11-28 12:00 ` Markus Armbruster
  0 siblings, 2 replies; 10+ messages in thread
From: Alon Levy @ 2012-11-28  8:54 UTC (permalink / raw)
  To: qemu-devel, lcapitulino, armbru

Instead of aborting immediately after at DEVICE_CLASS(obj)

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 hw/qdev-monitor.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/qdev-monitor.c b/hw/qdev-monitor.c
index 479eecd..3b70cdb 100644
--- a/hw/qdev-monitor.c
+++ b/hw/qdev-monitor.c
@@ -426,6 +426,11 @@ DeviceState *qdev_device_add(QemuOpts *opts)
         return NULL;
     }
 
+    if (!object_class_dynamic_cast(obj, "device")) {
+        qerror_report(QERR_INVALID_PARAMETER_TYPE, "driver", "device type");
+        return NULL;
+    }
+
     k = DEVICE_CLASS(obj);
 
     /* find bus */
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-11-28 12:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28  8:54 [Qemu-devel] [PATCH] hw/qdev-monitor: report error for -device <not-a-device-type> Alon Levy
2012-11-28 11:54 ` Luiz Capitulino
2012-11-28 12:02   ` Paolo Bonzini
2012-11-28 12:14     ` Luiz Capitulino
2012-11-28 12:19       ` Andreas Färber
2012-11-28 12:21         ` Luiz Capitulino
2012-11-28 12:18     ` Alon Levy
2012-11-28 12:15   ` Andreas Färber
2012-11-28 12:17   ` Alon Levy
2012-11-28 12:00 ` Markus Armbruster

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).