Received: from eggs.gnu.org ([208.118.235.92]:49121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sus8F-0005vb-DO for qemu-devel@nongnu.org; Fri, 27 Jul 2012 17:31:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sus8E-00083i-9r for qemu-devel@nongnu.org; Fri, 27 Jul 2012 17:31:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sus8E-00083T-1j for qemu-devel@nongnu.org; Fri, 27 Jul 2012 17:31:34 -0400 From: Luiz Capitulino Date: Fri, 27 Jul 2012 18:31:41 -0300 Message-Id: <1343424728-22461-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [RFC 00/27]: add new error format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, aliguori@us.ibm.com, eblake@redhat.com, armbru@redhat.com [Please, read below why this is an RFC] This series implements the 'Plan for error handling in QMP' as described by Anthony in this email: http://lists.gnu.org/archive/html/qemu-devel/2012-07/msg03764.html Basically, this replaces almost all error classes by GenericError (the exception are a few error classes used by libvirt) and drops the error data memeber. This also adds a free form string to error_set(). On the wire, we go from: { "error": { "class": "DeviceNotRemovable", "data": { "device": "virtio0" }, "desc": "Device 'virtio0' is not removable" } } to: { "error": { "class": "GenericError", "desc": "Device 'virtio0' is not removable" } } Internally, we go from: void error_set(Error **err, const char *fmt, ...); to: void error_set(Error **err, ErrorClass err_class, const char *fmt, ...); This series is in RFC state because when I was almost done I've found that I've broke error_is_type() and qemu-ga (both should be easy to fix). Besides, the resulting code is missing some simplifications and more testing... But I wanted to drop this before going out for the weekend :) QMP/qmp-spec.txt | 10 +- block.c | 1 + block_int.h | 1 + configure | 10 - error.c | 46 +---- error.h | 15 +- error_int.h | 1 - hmp.c | 80 +++++--- hmp.h | 1 + monitor.c | 80 ++------ qapi-schema.json | 33 +++- qerror.c | 514 ++------------------------------------------------ qerror.h | 164 ++++++++-------- qmp-commands.hx | 3 +- scripts/qapi-types.py | 17 +- scripts/qapi.py | 4 +- 16 files changed, 226 insertions(+), 754 deletions(-)