On 03/07/2011 05:14 AM, Stefan Hajnoczi wrote:
On Mon, Mar 7, 2011 at 1:22 AM, Anthony Liguori<aligu...@us.ibm.com>  wrote:
This will let Error share the QError human formatting.  This is only used for
HMP.

Signed-off-by: Anthony Liguori<aligu...@us.ibm.com>

diff --git a/qerror.c b/qerror.c
index 4855604..13d53c9 100644
--- a/qerror.c
+++ b/qerror.c
@@ -326,12 +326,18 @@ QError *qerror_from_info(const char *file, int linenr, 
const char *func,
     return qerr;
  }

-static void parse_error(const QError *qerror, int c)
+static void parse_error(const QErrorStringTable *entry, int c)
  {
-    qerror_abort(qerror, "expected '%c' in '%s'", c, qerror->entry->desc);
+#if 0
+    qerror_abort(qerror, "expected '%c' in '%s'", c, entry->desc);
+#else
+    fprintf(stderr, "expected '%c' in '%s'", c, entry->desc);
+    abort();
+#endif
It is not obvious to me what these #if 0 are doing.  Was this just a
quick hack that needs to be fixed before merge?

I should just drop the #if 0 parts.

This code path should disappear once we finish the QAPI conversion. The specific path only comes into play when a QError definition is incorrect which should only happen in development.

I didn't think it was worth trying to preserve the error messages as part of the code refactoring.

Regards,

Anthony Liguori

Stefan



Reply via email to