qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/22] qerror: expose a function to format an er


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 02/22] qerror: expose a function to format an error
Date: Mon, 07 Mar 2011 07:38:56 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10

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

Signed-off-by: Anthony Liguori<address@hidden>

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

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