From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtewA-0001ZL-9F for qemu-devel@nongnu.org; Thu, 19 Dec 2013 09:51:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vtew4-0002mS-9i for qemu-devel@nongnu.org; Thu, 19 Dec 2013 09:50:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtew3-0002mF-QP for qemu-devel@nongnu.org; Thu, 19 Dec 2013 09:50:48 -0500 From: armbru@redhat.com Date: Thu, 19 Dec 2013 15:30:13 +0100 Message-Id: <1387463413-20070-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH] qdev-monitor: Improve error message for -device nonexistant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: afaerber@suse.de, aliguori@amazon.com, lcapitulino@redhat.com From: Markus Armbruster Once upon a time, the error message was: qemu: -device nonexistant: "Device "nonexistant" not found. Try -device '?' for a list. But progress marches on, and conversion to QError (commit 0204276) changed it into: Invalid parameter 'driver' Try with argument '?' for a list. Progress didn't stop there, of course. After a couple of iterations, we arrived at the current message (commit 6acbe4c): qemu: -device nonexistant: Parameter 'driver' expects device type Mission accomplished: this is complete mush. We've since abandoned our quest for "rich" error objects, fortunately before it turned all error messages into mush. Time to undo the damage to this one. Make it: qemu: -device nonexistant: nonexistant is not a valid device model name Signed-off-by: Markus Armbruster --- qdev-monitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qdev-monitor.c b/qdev-monitor.c index dc37a43..6251107 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -478,7 +478,8 @@ DeviceState *qdev_device_add(QemuOpts *opts) } if (!oc) { - qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", "device type"); + qerror_report(ERROR_CLASS_GENERIC_ERROR, + "'%s' is not a valid device model name", driver); return NULL; } -- 1.8.1.4