From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MOtGX-00022J-67 for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MOtGS-0001zo-2Y for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:20 -0400 Received: from [199.232.76.173] (port=42373 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MOtGR-0001zi-Sk for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:15 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54482) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MOtGQ-00028J-Rx for qemu-devel@nongnu.org; Thu, 09 Jul 2009 09:02:15 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n69D2Exs016135 for ; Thu, 9 Jul 2009 09:02:14 -0400 From: Gerd Hoffmann Date: Thu, 9 Jul 2009 15:02:08 +0200 Message-Id: <1247144529-8805-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1247144529-8805-1-git-send-email-kraxel@redhat.com> References: <1247144529-8805-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] qdev: catch unknown devices in -device List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- 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