From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52962 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzDQV-0007BU-O4 for qemu-devel@nongnu.org; Mon, 14 Mar 2011 15:27:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzDQU-0004oB-5K for qemu-devel@nongnu.org; Mon, 14 Mar 2011 15:27:35 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:60395) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzDQU-0004nz-1g for qemu-devel@nongnu.org; Mon, 14 Mar 2011 15:27:34 -0400 Received: by yib19 with SMTP id 19so2671700yib.4 for ; Mon, 14 Mar 2011 12:27:33 -0700 (PDT) Message-ID: <4D7E6C22.8010102@codemonkey.ws> Date: Mon, 14 Mar 2011 14:27:30 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 02/11] qerror: expose a function to format an error References: <1299877249-13433-1-git-send-email-aliguori@us.ibm.com> <1299877249-13433-3-git-send-email-aliguori@us.ibm.com> <4D7A8F56.2080703@us.ibm.com> <20110314161728.36c3ca7e@doriath> In-Reply-To: <20110314161728.36c3ca7e@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org, Michael Roth , Markus Armbruster On 03/14/2011 02:17 PM, Luiz Capitulino wrote: > On Fri, 11 Mar 2011 15:08:38 -0600 > Anthony Liguori wrote: > >> On 03/11/2011 03:00 PM, Anthony Liguori wrote: >>> This will let Error share the QError human formatting. This is only used for >>> HMP. >>> >>> Signed-off-by: Anthony Liguori >>> >>> 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 >>> } >> Err, I shouldn't have left these #if 0's in here. Please ignore them. > But you're going to keep qerror_abort() usage, right? No, qerror_abort() needs to go away. It's too tied to QError and this patch is making the formatting code work outside of of QEMU. Once this whole series is completely merged, QError goes away entirely and this pretty formatting is replaced with something much simpler. Regards, Anthony Liguori