On 31 January 2013 16:36, Laszlo Ersek <ler...@redhat.com> wrote: > On 01/31/13 17:13, Peter Maydell wrote: >> On 31 January 2013 16:05, Laszlo Ersek <ler...@redhat.com> wrote: >>> On 01/31/13 16:54, Peter Maydell wrote: >>>> I thought we weren't adding any new QERR errors any more? >>> >>> How do you intend to inform the user about new error situations? If >>> error codes are a fixed set, then we need either a facility for freely >>> extending text in the error object, or for stacking separate messages in >>> the error object. >> >> The idea IIRC is that we just report everything with a free >> text message and a generic error class (apart from the legacy >> existing error classes). > > That is the polar opposite of what I'm trying to do; namely, > accumulating all info & error messages up to do_device_add(), and > branching hmp from qmp only above it. The internals should become fully > silent.
You probably need to pass in an Error** then, so the leaf can provide useful information at the point of error and then the top level code can deal with it appropriately whether hmp or qmp. For Error** error_setg() is the right way to specify arbitrary error text I think. -- PMM