Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-05 Thread Paolo Bonzini
Il 05/12/2013 16:32, Igor Mammedov ha scritto: >>> > > * make Error* mandatory for all void functions > one more advantage: > + not need to pepper every property setter/getter with local_error + > error_propagate(), > i.e. reduced code duplication. Note that for something like tail calls there

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-05 Thread Igor Mammedov
On Thu, 05 Dec 2013 11:37:27 +0100 Paolo Bonzini wrote: > Il 03/12/2013 21:33, Igor Mammedov ha scritto: > > I'm sorry for hijacking thread, but that actually an issue that started an > > original discussion. > > Where void returning QOM API functions are used with NULL, without any > > chance >

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-05 Thread Paolo Bonzini
Il 03/12/2013 21:33, Igor Mammedov ha scritto: > I'm sorry for hijacking thread, but that actually an issue that started an > original discussion. > Where void returning QOM API functions are used with NULL, without any chance > to detect that error happened. So abusing NULL errp in this functions

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-04 Thread Eric Blake
On 12/04/2013 02:11 AM, Markus Armbruster wrote: > No objection to asserting that the caller passed an error object when > the error object is the only way to signal failure. You can't force > your callers to check for failure, but the assertion could help prevent > accidental misuse. > > Assert

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-04 Thread Markus Armbruster
Eric Blake writes: > On 12/03/2013 01:33 PM, Igor Mammedov wrote: > Also, is it worth adding asserts and/or compiler annotations to require that the Error **err argument of functions be non-NULL, to ensure that callers are always passing either a valid destination or one of the >>>

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Eric Blake
On 12/03/2013 01:33 PM, Igor Mammedov wrote: >>> Also, is it worth adding asserts and/or compiler annotations to require >>> that the Error **err argument of functions be non-NULL, to ensure that >>> callers are always passing either a valid destination or one of the >>> special addresses? But do

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Igor Mammedov
On Tue, 03 Dec 2013 14:53:06 +0100 Markus Armbruster wrote: > Eric Blake writes: > > > On 12/03/2013 02:44 AM, Markus Armbruster wrote: > >> Peter Crosthwaite writes: > >> > >>> Following our discussion RE self asserting API calls, here is a spin of > >>> my proposal. This series obsoletes th

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Markus Armbruster
Eric Blake writes: > On 12/03/2013 02:44 AM, Markus Armbruster wrote: >> Peter Crosthwaite writes: >> >>> Following our discussion RE self asserting API calls, here is a spin of >>> my proposal. This series obsoletes the need for _nofail variants for >>> Error ** accepting APIs. Is also greatel

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Eric Blake
On 12/03/2013 02:44 AM, Markus Armbruster wrote: > Peter Crosthwaite writes: > >> Following our discussion RE self asserting API calls, here is a spin of >> my proposal. This series obsoletes the need for _nofail variants for >> Error ** accepting APIs. Is also greately reduces the verbosity of c

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Peter Crosthwaite
On Tue, Dec 3, 2013 at 9:57 PM, Paolo Bonzini wrote: > Il 03/12/2013 10:44, Markus Armbruster ha scritto: >> >> There are some _nofail functions left, but none of them can use >> error_abort. >> >> If anything assigns to error_abort, we're probably screwed. No bright >> idea how to prevent that a

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Paolo Bonzini
Il 03/12/2013 10:44, Markus Armbruster ha scritto: > > There are some _nofail functions left, but none of them can use > error_abort. > > If anything assigns to error_abort, we're probably screwed. No bright > idea how to prevent that at compile-time. Isn't it always used by address? Paolo

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Igor Mammedov
On Tue, 03 Dec 2013 10:44:57 +0100 Markus Armbruster wrote: > Peter Crosthwaite writes: > > > Following our discussion RE self asserting API calls, here is a spin of > > my proposal. This series obsoletes the need for _nofail variants for > > Error ** accepting APIs. Is also greately reduces th

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-03 Thread Markus Armbruster
Peter Crosthwaite writes: > Following our discussion RE self asserting API calls, here is a spin of > my proposal. This series obsoletes the need for _nofail variants for > Error ** accepting APIs. Is also greately reduces the verbosity of calls > sites that are currently asserting against errors

[Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups

2013-12-02 Thread Peter Crosthwaite
Following our discussion RE self asserting API calls, here is a spin of my proposal. This series obsoletes the need for _nofail variants for Error ** accepting APIs. Is also greately reduces the verbosity of calls sites that are currently asserting against errors. Patch 1 is the main event - addit