From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuPLX-0007Lh-4s for qemu-devel@nongnu.org; Thu, 26 Jul 2012 10:47:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuPLP-0000Qc-87 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 10:47:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuPLO-0000MY-W8 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 10:47:15 -0400 Date: Thu, 26 Jul 2012 11:47:23 -0300 From: Luiz Capitulino Message-ID: <20120726114723.68407821@doriath.home> In-Reply-To: <877gtqbu0t.fsf@blackfin.pond.sub.org> References: <1343235256-26310-1-git-send-email-lcapitulino@redhat.com> <1343235256-26310-10-git-send-email-lcapitulino@redhat.com> <877gtqbu0t.fsf@blackfin.pond.sub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Markus Armbruster Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Thu, 26 Jul 2012 14:12:50 +0200 Markus Armbruster wrote: > 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. Fixed for v3.