qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/9]: QError v3
@ 2009-11-12 20:42 Luiz Capitulino
  2009-11-12 20:42 ` [Qemu-devel] [PATCH 1/9] QJSON: Introduce qobject_from_json_va() Luiz Capitulino
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Luiz Capitulino @ 2009-11-12 20:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, kraxel, armbru

 Hi,

 This is a new QError version which implements what has been suggested
by Anthony in this email:

http://lists.gnu.org/archive/html/qemu-devel/2009-11/msg00601.html

 Basically, the error table is back and qemu_error_new() calls are like
this:

qemu_error_new(QERR_DEVICE_NOT_FOUND, driver);

 Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [Qemu-devel] [PATCH v0 0/9] QError
@ 2009-10-13 16:56 Luiz Capitulino
  2009-10-13 16:57 ` [Qemu-devel] [PATCH 9/9] monitor: do_info_balloon(): use QError Luiz Capitulino
  0 siblings, 1 reply; 13+ messages in thread
From: Luiz Capitulino @ 2009-10-13 16:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, kraxel

 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-11-13 12:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-12 20:42 [Qemu-devel] [PATCH 0/9]: QError v3 Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 1/9] QJSON: Introduce qobject_from_json_va() Luiz Capitulino
2009-11-12 21:39   ` Anthony Liguori
2009-11-13 12:31     ` Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 2/9] QString: Introduce qstring_append_chr() Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 3/9] QString: Introduce qstring_append_int() Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 4/9] Add qstring_append_chr() unit-test Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 5/9] Introduce QError Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 6/9] QJSON: Fix compile error Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 7/9] monitor: QError support Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 8/9] qdev: Use QError for 'device not found' error Luiz Capitulino
2009-11-12 20:42 ` [Qemu-devel] [PATCH 9/9] monitor: do_info_balloon(): use QError Luiz Capitulino
  -- strict thread matches above, loose matches on Subject: below --
2009-10-13 16:56 [Qemu-devel] [PATCH v0 0/9] QError Luiz Capitulino
2009-10-13 16:57 ` [Qemu-devel] [PATCH 9/9] monitor: do_info_balloon(): use QError Luiz Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).