search for: c0f0567

Displaying 5 results from an estimated 5 matches for "c0f0567".

Did you mean: 100567
2017 Jan 26
0
[nbdkit PATCH v2 3/6] protocol: Support ESHUTDOWN error
...gin may want this error value preserved across the wire rather than converted to EINVAL. Signed-off-by: Eric Blake <eblake@redhat.com> --- src/connections.c | 4 ++++ src/protocol.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/connections.c b/src/connections.c index e15a777..c0f0567 100644 --- a/src/connections.c +++ b/src/connections.c @@ -737,6 +737,10 @@ nbd_errno (int error) case EFBIG: case ENOSPC: return NBD_ENOSPC; +#ifdef ESHUTDOWN + case ESHUTDOWN: + return NBD_ESHUTDOWN; +#endif case EINVAL: default: return NBD_EINVAL; diff --git a/src/proto...
2017 Jan 26
0
[nbdkit PATCH v2 4/6] plugins: Add new nbdkit_set_error() utility function
...) (void *handle, const char *exportname); */ }; +extern void nbdkit_set_error (int err); extern void nbdkit_error (const char *msg, ...) __attribute__((format (printf, 1, 2))); extern void nbdkit_verror (const char *msg, va_list args); diff --git a/src/connections.c b/src/connections.c index c0f0567..83c863e 100644 --- a/src/connections.c +++ b/src/connections.c @@ -602,6 +602,19 @@ validate_request (struct connection *conn, return 1; /* Commands validates. */ } +/* Grab the appropriate error value. + */ +static int +_get_error (void) +{ + int err = errno; + int ret...
2017 Jan 26
10
[nbdkit PATCH v2 0/6] bind .zero to Python
Fix some things I noticed while reviewing v1, and follow Rich's idea to add a new nbdkit_set_error() utility function with a binding for Python users to request a particular error (rather than being forced to live with whatever stale value is in errno after all the intermediate binding glue code). I could not easily find out how to register a C function callable from perl bindings, and have
2017 Jan 27
0
[nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...ct nbdkit_plugin plugin = { .pwrite = plugin_rb_pwrite, .flush = plugin_rb_flush, .trim = plugin_rb_trim, + + .errno_is_reliable = plugin_rb_errno_is_reliable, }; NBDKIT_REGISTER_PLUGIN(plugin) diff --git a/src/connections.c b/src/connections.c index c0f0567..23e82a9 100644 --- a/src/connections.c +++ b/src/connections.c @@ -498,7 +498,10 @@ negotiate_handshake (struct connection *conn) int r; plugin_lock_request (conn); - if (!newstyle) + conn->errno_is_reliable = plugin_errno_is_reliable (conn); + if (conn->errno_is_reliable < 0) +...
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: