qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 00/27]: add new error format


From: Luiz Capitulino
Subject: [Qemu-devel] [RFC 00/27]: add new error format
Date: Fri, 27 Jul 2012 18:31:41 -0300

[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(-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]