qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 24/24] qdev-monitor: Improve error message for -devic


From: Andreas Färber
Subject: [Qemu-devel] [PULL 24/24] qdev-monitor: Improve error message for -device nonexistant
Date: Tue, 24 Dec 2013 17:57:17 +0100

From: Markus Armbruster <address@hidden>

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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
 qdev-monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qdev-monitor.c b/qdev-monitor.c
index 177b849..ef63cbd 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -479,7 +479,8 @@ DeviceState *qdev_device_add(QemuOpts *opts)
     }
 
     if (!object_class_dynamic_cast(oc, TYPE_DEVICE)) {
-        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.4




reply via email to

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