Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2017-01-09 Thread Eric Blake
On 01/09/2017 12:27 PM, Halil Pasic wrote: >>> I still do >>> not understand why were you wrong there. In fact, I could argue that you >>> were right, but I'm afraid the argument would be somewhat lengthy and >>> confusing, and I'm already feeling bad about taking so much of your time >>> with thi

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2017-01-09 Thread Halil Pasic
On 01/09/2017 03:50 PM, Eric Blake wrote: > On 07/29/2016 08:38 AM, Halil Pasic wrote: >> >> >> On 07/28/2016 11:03 PM, Eric Blake wrote: >>> On 07/28/2016 09:29 AM, Halil Pasic wrote: >>> > You mean va_start, not start_va. And actually, C11 is clear that errno > is unspecified after lib

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2017-01-09 Thread Eric Blake
On 07/29/2016 08:38 AM, Halil Pasic wrote: > > > On 07/28/2016 11:03 PM, Eric Blake wrote: >> On 07/28/2016 09:29 AM, Halil Pasic wrote: >> You mean va_start, not start_va. And actually, C11 is clear that errno is unspecified after library functions (but not macros) that don't exp

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2017-01-09 Thread Markus Armbruster
Markus Armbruster writes: > Sascha Silbe writes: > >> Dear Eric, >> >> Eric Blake writes: >> +++ b/include/qapi/error.h @@ -170,6 +170,9 @@ void error_setg_internal(Error **errp, * Just like error_setg(), with @os_error info added to the message. * If @os_error is non-ze

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-08-05 Thread Markus Armbruster
Sascha Silbe writes: > Dear Eric, > > Eric Blake writes: > >>> +++ b/include/qapi/error.h >>> @@ -170,6 +170,9 @@ void error_setg_internal(Error **errp, >>> * Just like error_setg(), with @os_error info added to the message. >>> * If @os_error is non-zero, ": " + strerror(os_error) is append

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-29 Thread Halil Pasic
On 07/28/2016 11:03 PM, Eric Blake wrote: > On 07/28/2016 09:29 AM, Halil Pasic wrote: > >>> You mean va_start, not start_va. And actually, C11 is clear that errno >>> is unspecified after library functions (but not macros) that don't >>> explicitly state otherwise. Since va_start() is a macro

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-28 Thread Eric Blake
On 07/28/2016 09:29 AM, Halil Pasic wrote: >> You mean va_start, not start_va. And actually, C11 is clear that errno >> is unspecified after library functions (but not macros) that don't >> explicitly state otherwise. Since va_start() is a macro and not a >> library function, that means va_start

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-28 Thread Halil Pasic
On 07/28/2016 04:56 PM, Eric Blake wrote: > On 07/28/2016 04:46 AM, Halil Pasic wrote: > >> The implementation of preserve errno seems inconsistent to me. The >> function error_setv is static, and I guess it is supposed to provide >> this indirect errno preservation and is used for both error_s

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-28 Thread Eric Blake
On 07/28/2016 04:46 AM, Halil Pasic wrote: > The implementation of preserve errno seems inconsistent to me. The > function error_setv is static, and I guess it is supposed to provide > this indirect errno preservation and is used for both error_setg und > error_setg_errno, yet error_setg_ errno_i

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-28 Thread Halil Pasic
On 07/28/2016 12:19 PM, Markus Armbruster wrote: > Eric Blake writes: > >> On 07/27/2016 03:24 AM, Sascha Silbe wrote: >>> C11 allows errno to be clobbered by pretty much any library function >>> call, so in general callers need to take care to save errno before >>> calling other functions. >>>

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-28 Thread Sascha Silbe
Dear Eric, Eric Blake writes: >> +++ b/include/qapi/error.h >> @@ -170,6 +170,9 @@ void error_setg_internal(Error **errp, >> * Just like error_setg(), with @os_error info added to the message. >> * If @os_error is non-zero, ": " + strerror(os_error) is appended to >> * the human-readable e

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-28 Thread Markus Armbruster
Eric Blake writes: > On 07/27/2016 03:24 AM, Sascha Silbe wrote: >> C11 allows errno to be clobbered by pretty much any library function >> call, so in general callers need to take care to save errno before >> calling other functions. >> >> However, for error reporting functions this is rather a

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-27 Thread Eric Blake
On 07/27/2016 03:24 AM, Sascha Silbe wrote: > C11 allows errno to be clobbered by pretty much any library function > call, so in general callers need to take care to save errno before > calling other functions. > > However, for error reporting functions this is rather awkward and can > make the co

Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-27 Thread Markus Armbruster
Sascha Silbe writes: > C11 allows errno to be clobbered by pretty much any library function > call, so in general callers need to take care to save errno before > calling other functions. > > However, for error reporting functions this is rather awkward and can > make the code on the caller side

[Qemu-devel] [PATCH] error: error_setg_errno(): errno gets preserved

2016-07-27 Thread Sascha Silbe
C11 allows errno to be clobbered by pretty much any library function call, so in general callers need to take care to save errno before calling other functions. However, for error reporting functions this is rather awkward and can make the code on the caller side more complicated than necessary. e