qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/7] QError v1
@ 2009-10-29 18:42 Luiz Capitulino
  2009-10-29 18:42 ` [Qemu-devel] [PATCH 1/7] QJSon: Introduce qobject_from_json_va() Luiz Capitulino
                   ` (7 more replies)
  0 siblings, 8 replies; 32+ messages in thread
From: Luiz Capitulino @ 2009-10-29 18:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, aliguori, kraxel, hollisb

 Hi there,

 This is a new version of the QError framework.

 I've been through the last QError thread and tried to collect the best
suggestions. The important changes are:

- Dropped the .user_print function
- Added Paolo's suggestion on having a printf-like format for 'desc'
- Line number and filename are also stored in the QError object
- Uses QJSon

 Now, a call like:

monitor_printf(mon, "husb: host usb device %d.%d is already open\n",
                      bus_num, addr);

 Would become:

qemu_error_structed("{ 'bus_num': %d, 'addr': %d }", bus_num, addr);

 Its error table entry should be:

{
    .code = QERR_USB_EOPEN,
    .desc = "husb: host usb device %(bus_num)d.%(addr)d is already open",
}

 Finally, on the wire we'd have:

{ "error": { "code": 45,
             "data": { "bus_num": 1, "addr": 0xff } } }

 As the previous version, qemu_error_structed() builds on top of Gerd's
QemuErrorSink API.

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

 A last note: this series is on top of the (to be merged) QJSon module,
that's why it's a RFC and.. I didn't test it too much. :)

 Thanks.

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

end of thread, other threads:[~2009-11-01 10:39 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 18:42 [Qemu-devel] [RFC 0/7] QError v1 Luiz Capitulino
2009-10-29 18:42 ` [Qemu-devel] [PATCH 1/7] QJSon: Introduce qobject_from_json_va() Luiz Capitulino
2009-10-29 18:42 ` [Qemu-devel] [PATCH 2/7] Introduce QError Luiz Capitulino
2009-10-29 20:14   ` [Qemu-devel] " Anthony Liguori
2009-10-29 20:48     ` Luiz Capitulino
2009-10-29 22:08       ` Paolo Bonzini
2009-10-30  2:25         ` Jamie Lokier
2009-10-30 13:05         ` Anthony Liguori
2009-10-30 13:48           ` Luiz Capitulino
2009-10-29 18:42 ` [Qemu-devel] [PATCH 3/7] monitor: QError support Luiz Capitulino
2009-10-29 18:42 ` [Qemu-devel] [PATCH 4/7] QError: Add QERR_DEV_NFOUND Luiz Capitulino
2009-10-29 18:42 ` [Qemu-devel] [PATCH 5/7] qdev: Use QError for not found error Luiz Capitulino
2009-10-29 18:42 ` [Qemu-devel] [PATCH 6/7] QError: Add do_info_balloon() errors Luiz Capitulino
2009-10-29 18:42 ` [Qemu-devel] [PATCH 7/7] monitor: do_info_balloon(): use QError Luiz Capitulino
2009-10-29 22:12 ` [Qemu-devel] Re: [RFC 0/7] QError v1 Paolo Bonzini
2009-10-30 12:28   ` Luiz Capitulino
2009-10-30 12:56     ` Gerd Hoffmann
2009-10-30 13:09       ` Anthony Liguori
2009-10-30 13:45         ` Paolo Bonzini
2009-10-30 13:47         ` Luiz Capitulino
2009-10-30 13:59           ` Anthony Liguori
2009-10-30 14:46             ` Luiz Capitulino
2009-10-30 16:28         ` Jamie Lokier
2009-10-30 16:34           ` Paolo Bonzini
2009-10-30 17:15           ` Daniel P. Berrange
2009-10-30 17:33             ` Paolo Bonzini
2009-10-30 17:48               ` Anthony Liguori
2009-11-01 12:28               ` Vincent Hanquez
2009-10-30 17:40           ` Anthony Liguori
2009-10-30 18:09             ` Jamie Lokier
2009-10-30 18:10               ` Paolo Bonzini
2009-10-30 19:04               ` Anthony Liguori

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).