Skip to content

QError

Luiz Capitulino qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v0 Latest9 patches 53 repliesIn review

Patches in v0 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9QDict: Introduce qdict_iter()qdict.c qdict.h+22 -00 replies
2/9check-qdict: Add test for qdict_iter()check-qdict.c+35 -00 replies
3/9qmisc: Introduce qobject_from_va()qmisc.c qmisc.h+33 -133 replies
4/9Introduce QErrorMakefile qerror.c qerror.h +1 more+238 -10 replies
5/9monitor: QError supportmonitor.c sysemu.h+45 -13 replies
6/9QError: Add qdev not found errorqerror.c qerror.h+13 -031 replies
7/9qdev: Use QError for not found errorhw/qdev.c+2 -212 replies
8/9QError: Add do_info_balloon() errorsqerror.c qerror.h+9 -00 replies
9/9monitor: do_info_balloon(): use QErrormonitor.c+2 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v0 yet.

Read the v0 thread

Cover letter [Qemu-devel] [PATCH v0 0/9] QError

This series adds infrastructure which will be needed by the future monitor
protocol to handle and emit error information correctly.

QError is a QObject designed to stored error information in way that it can
be emitted by the protocol code or printed in an user friendly way.

To use it in the Monitor and its handlers, I've added a function called
qemu_error_structed(), which builds on top of Gerd's QemuErrorSink API, this means that it is also capable of printing error information to stderr.

Basically, we have a QError member in the Monitor struct, which will be set
if an error has occurred. The Monitor's top level code will check it at handler exit time and handle the error properly.

QError represents an error, and it has the following properties:

- Error code
- Error general description
- Error specific data

Code and description are stored in a static table in the QError module itself,
the error specific data is generated at error time by the function calling qemu_error_structed().

This design is based on the way I plan to emit error information in the
protocol, which is:

{ "error": { "code": json-number,

             "desc": json-string,
             "data": json-value } "id": json-value, "timestamp": json-string }

Besides introducing QError, this series also has simple usage examples for
qdev_device_add() and do_info_balloon().

Hopefully this is the last big piece of infrastructure before having the
protocol parser itself.

Please, review carefully.

Thanks.

PS: Applies on top of my last series.