Received: from eggs.gnu.org ([208.118.235.92]:45178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuMwD-0004P0-Ue for qemu-devel@nongnu.org; Thu, 26 Jul 2012 08:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuMw8-0003BQ-16 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 08:13:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuMw7-0003BI-PL for qemu-devel@nongnu.org; Thu, 26 Jul 2012 08:12:59 -0400 From: Markus Armbruster References: <1343235256-26310-1-git-send-email-lcapitulino@redhat.com> <1343235256-26310-10-git-send-email-lcapitulino@redhat.com> Date: Thu, 26 Jul 2012 14:12:50 +0200 In-Reply-To: <1343235256-26310-10-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Wed, 25 Jul 2012 13:54:14 -0300") Message-ID: <877gtqbu0t.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 09/11] qapi: add qapi-errors.py List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Luiz Capitulino writes: > This script generates two files from qapi-schema-errors.json: > > o qapi-errors.h: contains error macro definitions, eg. QERR_BASE_NOT_FOUND, > corresponds to most of today's qerror.h > > o qapi-errors.c: contains the error table that currently exists in qerror.c [...] > diff --git a/scripts/qapi-errors.py b/scripts/qapi-errors.py > new file mode 100644 > index 0000000..59cf426 > --- /dev/null > +++ b/scripts/qapi-errors.py [...] > +def gen_error_def_table(exprs): > + ret = mcgen(''' > +static const QErrorStringTable qerror_table[] = { > +''') > + > + for err in exprs: > + macro = gen_error_macro(err['error']) > + desc = err['description'] > + ret += mcgen(''' > + { > + .error_fmt = %(error_macro)s, > + .desc = "%(error_desc)s", > + }, > +''', Trailing whitespace. [...]