From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrYMy-0005HT-NQ for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrYMx-00070i-Gv for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:49:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrYMx-00070a-99 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 13:49:03 -0400 From: Luiz Capitulino Date: Wed, 18 Jul 2012 14:49:11 -0300 Message-Id: <1342633760-351-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 0/9]: qapi: generate qerrors from qapi-schema-errors.json List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, aliguori@us.ibm.com, armbru@redhat.com This series moves all qerrors we have today to qapi-schema-errors.json and generate the error macros and table from it. With this series, one doesn't have to manually add an error macro and the matching table entry anymore. He or she just have to add the new error to qapi-schema-errors.json. There's only one small problem: the matching between error class name and the (generated) error macro may not be clear for those not familirized with qerrors. There are two possible solutions to this: 1. Add the generated macro name along with the error class name in qapi-schema-json-errors.json; and/or 2. add docs/qapi-errors.txt to explain this in detail This series is my first step on improving our error API. Makefile | 8 +- hw/qdev-properties.c | 2 +- migration-tcp.c | 6 +- monitor.c | 2 +- qapi-schema-errors.json | 616 +++++++++++++++++++++++++++++++++++++++++++++++ qapi/qmp-dispatch.c | 2 +- qapi/qmp-input-visitor.c | 2 +- qemu-sockets.c | 22 +- qerror.c | 310 +----------------------- qerror.h | 220 +---------------- scripts/check-qerror.sh | 6 +- scripts/qapi-errors.py | 180 ++++++++++++++ scripts/qapi.py | 4 +- 13 files changed, 827 insertions(+), 553 deletions(-)