qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/2] qdev: catch unknown devices in -device


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 1/2] qdev: catch unknown devices in -device
Date: Thu, 9 Jul 2009 15:02:08 +0200

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 hw/qdev.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/qdev.c b/hw/qdev.c
index 979ed4f..009e68d 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -133,6 +133,11 @@ DeviceState *qdev_device_add(const char *cmdline)
     }
     info = qdev_find_info(NULL, driver);
 
+    if (!info) {
+        fprintf(stderr, "Device \"%s\" not found.  Try -device '?' for a 
list.\n",
+                driver);
+        return NULL;
+    }
     if (!info->bus_info->add) {
         fprintf(stderr, "bus \"%s\" can't add devices.\n",
                 info->bus_info->name);
-- 
1.6.2.5





reply via email to

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