Skip to contentSkip to conversation

Avoid extra error for do_cpu_set()

PATCH Applied Markus Armbruster 2 participants 4 messages Jan 29, 2010 – Feb 3, 2010

lore
Share & tools
lore
#0 lore raw

cover Avoid extra error for do_cpu_set()

The conversion created a special error, to avoid changing the error message in the human monitor. Anthony thinks that's not necessary. Remove it and use a suitable generic error instead.

Markus Armbruster (2):
monitor: Use QERR_INVALID_PARAMETER instead of QERR_INVALID_CPU_INDEX Revert "QError: New QERR_INVALID_CPU_INDEX"

 monitor.c |    2 +-
 qerror.c  |    4 ----
 qerror.h  |    3 ---
 3 files changed, 1 insertions(+), 8 deletions(-)
#1 lore raw

PATCH 1/2 monitor: Use QERR_INVALID_PARAMETER instead of QERR_INVALID_CPU_INDEX

This changes the error message from "Invalid CPU index" to "Invalid parameter index" in the human monitor.

---
 monitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
monitor.c +1 -1
index fb7c572..69ebac5 100644
@@ -897,7 +897,7 @@ static void do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     int index = qdict_get_int(qdict, "index");
     if (mon_set_cpu(index) < 0)
-        qemu_error_new(QERR_INVALID_CPU_INDEX);
+        qemu_error_new(QERR_INVALID_PARAMETER, "index");
 }
 
 static void do_info_jit(Monitor *mon)
Signature · 1 line
1.6.6
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] monitor: Use QERR_INVALID_PARAMETER instead of QERR_INVALID_CPU_INDEX

Quoted 5 lines · Markus Armbruster

This changes the error message from "Invalid CPU index" to "Invalid parameter index" in the human monitor.

Applied both. Thanks.

Regards,

Anthony Liguori

Quoted 18 lines
---
  monitor.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
monitor.c +1 -1
index fb7c572..69ebac5 100644
@@ -897,7 +897,7 @@ static void do_cpu_set(Monitor *mon, const QDict *qdict, QObject **ret_data)
  {
      int index = qdict_get_int(qdict, "index");
      if (mon_set_cpu(index)<  0)
-        qemu_error_new(QERR_INVALID_CPU_INDEX);
+        qemu_error_new(QERR_INVALID_PARAMETER, "index");
  }
 
  static void do_info_jit(Monitor *mon)
#3 lore raw

PATCH 2/2 Revert "QError: New QERR_INVALID_CPU_INDEX"

In reply to Markus Armbruster

This reverts commit 64a34bb14c0e358a6b2f14805e59ef25bf62d6d5.

---
 qerror.c |    4 ----
 qerror.h |    3 ---
 2 files changed, 0 insertions(+), 7 deletions(-)
qerror.c +0 -4
index 6c2aba0..2f657f4 100644
@@ -81,10 +81,6 @@ static const QErrorStringTable qerror_table[] = {
         .desc      = "Invalid block format %(name)",
     },
     {
-        .error_fmt = QERR_INVALID_CPU_INDEX,
-        .desc      = "Invalid CPU index",
-    },
-    {
         .error_fmt = QERR_INVALID_PARAMETER,
         .desc      = "Invalid parameter %(name)",
     },
qerror.h +0 -3
index 57c5b97..ee59615 100644
@@ -70,9 +70,6 @@ QError *qobject_to_qerror(const QObject *obj);
 #define QERR_INVALID_BLOCK_FORMAT \
     "{ 'class': 'InvalidBlockFormat', 'data': { 'name': %s } }"
 
-#define QERR_INVALID_CPU_INDEX \
-    "{ 'class': 'InvalidCPUIndex', 'data': {} }"
-
 #define QERR_INVALID_PARAMETER \
     "{ 'class': 'InvalidParameter', 'data': { 'name': %s } }"
 
Signature · 1 line
1.6.6