search for: get_error

Displaying 20 results from an estimated 95 matches for "get_error".

2010 Mar 16
1
com32/modules/disk patch to fix crash (syslinux 4)
This patch fixes a crash in disk.c32 owing to the change in get_error()'s signature. Instead of calling get_error() I just dump the error code. don diff --git a/com32/modules/disk.c b/com32/modules/disk.c index e94a36b..2966173 100644 --- a/com32/modules/disk.c +++ b/com32/modules/disk.c @@ -37,11 +37,8 @@ int main(int argc __attribute__ (( unused )),...
2017 Feb 20
1
Re: Fwd: nbdkit async
The concern is a client is blocked while processing a request. The nbdkit server design requires a thread per request being processed regardless of the number of connections or clients. We want to run 1000's of requests in parallel without needing a thread at nbdkit layer per request in flight. Our plugin layer is built around boost asio and a few threads in a worker pool running an io
2018 Feb 01
0
[nbdkit PATCH v2 1/3] backend: Rework internal/filter error return semantics
...#include <sys/types.h> #include <stddef.h> +#include <assert.h> #include <pthread.h> @@ -912,18 +913,6 @@ validate_request (struct connection *conn, return true; /* Command validates. */ } -/* Grab the appropriate error value. - */ -static int -get_error (struct connection *conn) -{ - int ret = threadlocal_get_error (); - - if (!ret && backend->errno_is_preserved (backend)) - ret = errno; - return ret ? ret : EIO; -} - /* This is called with the request lock held to actually execute the * request (by calling the plugin). Note t...
2019 Aug 13
3
[nbdkit PATCH 0/2] errno cleanup patches
I ran into these while trying to prepare patches to add NBD_CMD_FLAG_FAST_ZERO, which will expose a new NBD_ENOTSUP wire value. Eric Blake (2): plugins: Don't lose original error when emulating FUA plugins: Permit ENOTSUP as synonym for EOPNOTSUPP docs/nbdkit-filter.pod | 11 ++++++----- docs/nbdkit-plugin.pod | 12 +++++++----- plugins/file/file.c | 16 +++++++++++-----
2017 Jan 27
0
[nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...if (!newstyle) r = _negotiate_handshake_oldstyle (conn); else r = _negotiate_handshake_newstyle (conn); @@ -602,6 +605,18 @@ validate_request (struct connection *conn, return 1; /* Commands validates. */ } +/* Grab the appropriate error value. + */ +static int +get_error (struct connection *conn) +{ + int ret = 0; + + if (conn->errno_is_reliable) + ret = errno; + return ret ? ret : EIO; +} + /* This is called with the request lock held to actually execute the * request (by calling the plugin). Note that the request fields have * been validated alread...
2017 Nov 17
8
[RFC nbdkit PATCH 0/6] Enable full parallel request handling
I want to make my nbd forwarding plugin fully parallel - but to do that, I first need to make nbdkit itself fully parallel ;) With this series, I was finally able to demonstrate out-of-order responses when using qemu-io (which is great at sending back-to-back requests prior to waiting for responses) coupled with the nbd file plugin (which has a great feature of rdelay and wdelay, to make it
2018 Mar 08
0
[nbdkit PATCH v3 11/15] plugins: Expose new FUA callbacks
...set); + if (p->plugin.pread) + r = p->plugin.pread (connection_get_handle (conn, 0), buf, count, offset, + 0); + else + r = p->plugin._pread_old (connection_get_handle (conn, 0), buf, count, + offset); if (r == -1) *err = get_error (p); return r; @@ -421,16 +438,17 @@ plugin_flush (struct backend *b, struct connection *conn, uint32_t flags, debug ("flush"); - if (p->plugin.flush != NULL) { - r = p->plugin.flush (connection_get_handle (conn, 0)); - if (r == -1) - *err = get_error (p); - r...
2018 Jan 28
3
[nbdkit PATCH 0/2] RFC: tweak error handling, add log filter
Here's what I'm currently playing with; I'm not ready to commit anything until I rebase my FUA work on top of this, as I only want to break filter ABI once between releases. Eric Blake (2): backend: Rework internal/filter error return semantics filters: Add log filter TODO | 2 - docs/nbdkit-filter.pod | 84 +++++++-- docs/nbdkit.pod
2018 Mar 22
1
[nbdkit PATCH] plugins: Add .can_zero callback
...m the earlier exposure of .can_fua to plugins a few patches ago, but that is okay as there has not been a release in the meantime (the logical grouping was nicer this way). Had a release happened, .can_zero would have to be placed after .zero in struct nbdkit_plugin. Also, in plugins.c, rearrange get_error() to a more logical location. Signed-off-by: Eric Blake <eblake@redhat.com> --- This sort of fell out from the v2v rhv-upload conversation on the list, although Rich's v7 patch there demonstrates that even when oVirt lacks zero support, the rhv-upload plugin still wants .zero to be call...
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...if (r < 0) { @@ -703,7 +705,7 @@ _negotiate_handshake_newstyle (struct connection *conn) return -1; /* Finish the newstyle handshake. */ - r = plugin_get_size (conn); + r = backend->get_size (backend, conn); if (r == -1) return -1; if (r < 0) { @@ -848,7 +850,7 @@ get_error (struct connection *conn) { int ret = threadlocal_get_error (); - if (!ret && plugin_errno_is_preserved ()) + if (!ret && backend->errno_is_preserved (backend)) ret = errno; return ret ? ret : EIO; } @@ -881,28 +883,28 @@ handle_request (struct connection *conn,...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...if (r < 0) { @@ -703,7 +705,7 @@ _negotiate_handshake_newstyle (struct connection *conn) return -1; /* Finish the newstyle handshake. */ - r = plugin_get_size (conn); + r = backend->get_size (backend, conn); if (r == -1) return -1; if (r < 0) { @@ -848,7 +850,7 @@ get_error (struct connection *conn) { int ret = threadlocal_get_error (); - if (!ret && plugin_errno_is_preserved ()) + if (!ret && backend->errno_is_preserved (backend)) ret = errno; return ret ? ret : EIO; } @@ -881,28 +883,28 @@ handle_request (struct connection *conn,...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...if (r < 0) { @@ -703,7 +705,7 @@ _negotiate_handshake_newstyle (struct connection *conn) return -1; /* Finish the newstyle handshake. */ - r = plugin_get_size (conn); + r = backend->get_size (backend, conn); if (r == -1) return -1; if (r < 0) { @@ -848,7 +850,7 @@ get_error (struct connection *conn) { int ret = threadlocal_get_error (); - if (!ret && plugin_errno_is_preserved ()) + if (!ret && backend->errno_is_preserved (backend)) ret = errno; return ret ? ret : EIO; } @@ -881,28 +883,28 @@ handle_request (struct connection *conn,...
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:
2020 Aug 17
2
Re: [nbdkit] Windows errno handling
...ry to >> translate the codes to errno E* values. I need to look at exactly >> what's going on here. >> >> Number (5) is actually fairly easy to deal with because there's only >> one place where we handle the errno returned by plugins >> (server/plugins.c:get_error). I think we'd probably want >> errno_is_preserved to mean "WSAGetLastError" or "GetLastError" >> contains something of interest. >> >> Thoughts? >> >> Also I really need to look at how some other portable libraries like >> curl and...
2018 Jan 16
9
[nbdkit PATCH 0/7] Initial implementation of FUA flag passthrough
Tested via: term1$ qemu-nbd -k $PWD/sock -t -f raw -x foo junk --trace=nbd_\* term2$ ./nbdkit -f -v -e bar nbd socket=$PWD/sock export=foo term3$ qemu-io -t none -f raw nbd://localhost:10809/bar --trace=nbd_\* and checking the traces to see that 'w 0 1' vs. 'w -f 0 1' was able to influence whether the FUA flag showed up at the server in term1. Still to go: figure out how to
2018 Feb 01
2
Re: [nbdkit PATCH v2 1/3] backend: Rework internal/filter error return semantics
.../* Clear the error, so that we know if the plugin calls > + nbdkit_set_error() or relied on errno. */ > threadlocal_set_error (0); > > switch (cmd) { > case NBD_CMD_READ: > - if (backend->pread (backend, conn, buf, count, offset, 0) == -1) > - return get_error (conn); > - break; > + return backend->pread (backend, conn, buf, count, offset, 0); ... > - default: > - abort (); > + return backend->zero (backend, conn, count, offset, f); > } > - > - return 0; > + /* Unreachable */ > + abort (); > }...
2020 Aug 17
3
[nbdkit] Windows errno handling
...isingly). However it does _not_ seem to work if we try to translate the codes to errno E* values. I need to look at exactly what's going on here. Number (5) is actually fairly easy to deal with because there's only one place where we handle the errno returned by plugins (server/plugins.c:get_error). I think we'd probably want errno_is_preserved to mean "WSAGetLastError" or "GetLastError" contains something of interest. Thoughts? Also I really need to look at how some other portable libraries like curl and gnutls are handling this. Maybe they've already come up...
2014 Nov 25
2
CentOS-5.10 Sendmail STARTTLS error
This morning I discovered this in the logwatch report for our external MX backup host. STARTTLS: write error=syscall error (-1), errno=32, get_error=error:00000000:lib(0):func(0):reason(0), retry=99, ssl_err=5: 206 Time(s) I also see many entries similar to this: 8: fl=0x802, mode=140777: SOCK inet04.mississauga.harte-lyne.ca/34091->(Transport endpoint is not connected): 1 Time(s) MCI at 0x8055b34: flags=27c86c<CACHED,ESMT...
2018 Feb 01
6
[nbdkit PATCH v2 0/3] add log, blocksize filters
Since v1: add the blocksize filter, add testsuite coverage of the log filter, several fixes to the log filter based on what adding tests revealed I'm still working on FUA flag support patches on top of this; the patches should all be committed in the same release, as we want to minimize the number of releases that cause a filter ABI/API bump Eric Blake (3): backend: Rework internal/filter
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2: - Fixed everything mentioned in the review. Rich.