search for: errno_is_reliable

Displaying 12 results from an estimated 12 matches for "errno_is_reliable".

2017 Feb 06
0
[PATCH 1/2] Define .errno_is_preserved constant instead of a .errno_is_reliable callback.
..._error> to influence the error code that will be sent to the client. These two functions can be called in either order. Then, -the callback should return the appropriate error indication, eg. NULL -or -1. If the call to C<nbdkit_set_error> is omitted while serving -data, then the C<.errno_is_reliable> callback controls whether to fall -back to the value of C<errno> or a hard-coded C<EIO>. +the callback should return the appropriate error indication, +eg. C<NULL> or C<-1>. + +If the call to C<nbdkit_set_error> is omitted while serving data, then +the global varia...
2017 Feb 06
3
[PATCH nbdkit 0/2] Change .errno_is_reliable function to .errno_is_preserved constant.
See patch 1 for rationale.
2017 Jan 27
0
[nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...n error in the plugin, the plugin should call C<nbdkit_error> with the error message, and then return an error -indication from the callback, eg. NULL or -1. +indication from the callback, eg. NULL or -1. When a callback fails, +the NBD protocol sends an error code to the client; the +C<.errno_is_reliable> callback controls whether this error code +will default to something based on C<errno>, or if it will just +be hard-coded to C<EIO>. C<nbdkit_error> has the following prototype and works like L<printf(3)>: void nbdkit_error (const char *fs, ...); + void nbdkit_verr...
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit use of errno from language bindings, then rebases the previous work in python on top of that. I'm still playing with the perl bindings, but got further after reading 'perldoc perlembed'. Eric Blake (4): plugins: Don't use bogus errno from non-C plugins plugins: Add new nbdkit_set_error() utility function python:
2017 Feb 06
1
Re: [PATCH 1/2] Define .errno_is_preserved constant instead of a .errno_is_reliable callback.
On 02/06/2017 08:57 AM, Richard W.M. Jones wrote: > The callback doesn't make much sense: Could the value change > per-connection? Unlikely. This is a property of the plugin as a > whole. > > I changed the name to "errno_is_preserved", because it's not about the > reliability of errno, but about whether errno is preserved across > calls. Makes it possible
2017 Jan 26
2
Re: [nbdkit PATCH v2 4/6] plugins: Add new nbdkit_set_error() utility function
On Wed, Jan 25, 2017 at 08:42:34PM -0600, Eric Blake wrote: > +eg. NULL or -1. If the call to C<nbdkit_set_error> is omitted, then > +the value of C<errno> will be used instead. [...] > +/* Grab the appropriate error value. > + */ > +static int > +_get_error (void) > +{ > + int err = errno; > + int ret = tls_get_error (); > + > + if (!ret) > +
2017 Jan 26
1
Re: [nbdkit PATCH v2 4/6] plugins: Add new nbdkit_set_error() utility function
...of errno if > nbdkit_set_error() was not called, but even that error is still almost > always wrong); but it will be a regression in quality for existing C > plugins that aren't retrofitted to call nbdkit_set_error() everywhere. > > How about this: we add a new boolean callback .errno_is_reliable(), > which defaults to true if omitted. C plugins that don't implement the > new callback will continue to use implicit errno, for backwards > compatibility and no regression; such a plugin can avoid > nbdkit_set_error (although using it won't hurt, and will make it so that &gt...
2017 Jan 26
0
Re: [nbdkit PATCH v2 4/6] plugins: Add new nbdkit_set_error() utility function
...w default to EIO instead of errno if nbdkit_set_error() was not called, but even that error is still almost always wrong); but it will be a regression in quality for existing C plugins that aren't retrofitted to call nbdkit_set_error() everywhere. How about this: we add a new boolean callback .errno_is_reliable(), which defaults to true if omitted. C plugins that don't implement the new callback will continue to use implicit errno, for backwards compatibility and no regression; such a plugin can avoid nbdkit_set_error (although using it won't hurt, and will make it so that an accidental errno cor...
2017 Jan 27
0
[nbdkit PATCH v3 4/4] python: Support zero callback
...t have to return anything, but should use nbdkit.set_error(errno.EOPNOTSUPP) to get an automatic fallback to pwrite. Enhance the example to show the use of the fallback mechanism, and to serve as a test of nbdkit.set_error(). Signed-off-by: Eric Blake <eblake@redhat.com> --- v2: rebase to .errno_is_reliable --- plugins/python/example.py | 11 ++++++++ plugins/python/nbdkit-python-plugin.pod | 20 ++++++++++++++ plugins/python/python.c | 46 +++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/plugins/python/example.py b/plugins/python/example...
2017 Feb 02
3
[nbdkit PATCH 0/2] Ruby bindings for .zero
Similar to python and perl. But MUCH easier (especially considering that this is the first time I've every tried to run Ruby). I even had fun making set_error() polymorphic. Eric Blake (2): ruby: Expose nbdkit_set_error to ruby script ruby: Support zero callback plugins/ruby/example.rb | 11 ++++++++ plugins/ruby/nbdkit-ruby-plugin.pod | 54
2017 Jan 31
4
[nbdkit PATCH v3 0/3] bind .zero to Perl
Requires patch 1 and 2 of the python series: https://www.redhat.com/archives/libguestfs/2017-January/msg00126.html This is the perl implementation along the same lines. We still haven't decided if patch 1 of the python series should change OCaml to report errno as reliable or not, but perhaps we can commit that patch as-is now and then touch things up further when we actually get set_error
2017 Feb 02
0
[nbdkit PATCH 2/2] ruby: Support zero callback
...ic int plugin_rb_can_write (void *handle) { volatile VALUE argv[1]; @@ -483,6 +510,7 @@ static struct nbdkit_plugin plugin = { .pwrite = plugin_rb_pwrite, .flush = plugin_rb_flush, .trim = plugin_rb_trim, + .zero = plugin_rb_zero, .errno_is_reliable = plugin_rb_errno_is_reliable, }; -- 2.9.3