Patchwork [10/21] error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER

login
register
mail settings
Submitter Luiz Capitulino
Date April 5, 2010, 8:33 p.m.
Message ID <1270499642-31543-11-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/49448/
State New
Headers show

Comments

Luiz Capitulino - April 5, 2010, 8:33 p.m.
From: Markus Armbruster <armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 hw/qdev.c |    2 +-
 monitor.c |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index 5ca126b..d3bf0fa 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -207,7 +207,7 @@  DeviceState *qdev_device_add(QemuOpts *opts)
     /* find driver */
     info = qdev_find_info(NULL, driver);
     if (!info || info->no_user) {
-        qerror_report(QERR_INVALID_PARAMETER, "driver");
+        qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", "a driver name");
         error_printf_unless_qmp("Try with argument '?' for a list.\n");
         return NULL;
     }
diff --git a/monitor.c b/monitor.c
index 89952e8..792c8ce 100644
--- a/monitor.c
+++ b/monitor.c
@@ -970,7 +970,8 @@  static int do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     int index = qdict_get_int(qdict, "index");
     if (mon_set_cpu(index) < 0) {
-        qerror_report(QERR_INVALID_PARAMETER, "index");
+        qerror_report(QERR_INVALID_PARAMETER_VALUE, "index",
+                      "a CPU number");
         return -1;
     }
     return 0;
@@ -2490,7 +2491,8 @@  static int do_getfd(Monitor *mon, const QDict *qdict, QObject **ret_data)
     }
 
     if (qemu_isdigit(fdname[0])) {
-        qerror_report(QERR_INVALID_PARAMETER, "fdname");
+        qerror_report(QERR_INVALID_PARAMETER_VALUE, "fdname",
+                      "a name not starting with a digit");
         return -1;
     }