Displaying 20 results from an estimated 25 matches for "plugin_errno_is_preserved".
2017 Feb 06
0
[PATCH 1/2] Define .errno_is_preserved constant instead of a .errno_is_reliable callback.
...f (!newstyle)
+ if (!newstyle)
r = _negotiate_handshake_oldstyle (conn);
else
r = _negotiate_handshake_newstyle (conn);
@@ -612,7 +609,7 @@ get_error (struct connection *conn)
{
int ret = tls_get_error ();
- if (!ret && conn->errno_is_reliable)
+ if (!ret && plugin_errno_is_preserved ())
ret = errno;
return ret ? ret : EIO;
}
diff --git a/src/internal.h b/src/internal.h
index aa7dbd3..e73edf1 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -120,7 +120,6 @@ struct connection {
int can_flush;
int is_rotational;
int can_trim;
- int errno_is_reliable;
};...
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...urn -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,
switch (cmd) {
case NBD_CMD_READ:
- if (plugin_pread (conn, buf, count, offset) == -1)
+ if (backend->...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...urn -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,
switch (cmd) {
case NBD_CMD_READ:
- if (plugin_pread (conn, buf, count, offset) == -1)
+ if (backend->...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...urn -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,
switch (cmd) {
case NBD_CMD_READ:
- if (plugin_pread (conn, buf, count, offset) == -1)
+ if (backend->...
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2:
- Fixed everything mentioned in the review.
Rich.
2017 Feb 06
3
[PATCH nbdkit 0/2] Change .errno_is_reliable function to .errno_is_preserved constant.
See patch 1 for rationale.
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are
called. This patch is in preparation for adding a second backend
subtype for filters.
Rich.
2018 Feb 01
0
[nbdkit PATCH v2 1/3] backend: Rework internal/filter error return semantics
...est (conn);
}
diff --git a/src/filters.c b/src/filters.c
index 40c4913..1003dc7 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -107,14 +107,6 @@ filter_thread_model (struct backend *b)
/* These are actually passing through to the final plugin, hence
* the function names.
*/
-static int
-plugin_errno_is_preserved (struct backend *b)
-{
- struct backend_filter *f = container_of (b, struct backend_filter, backend);
-
- return f->backend.next->errno_is_preserved (f->backend.next);
-}
-
static const char *
plugin_name (struct backend *b)
{
@@ -463,17 +455,23 @@ filter_pread (struct backend *b, str...
2018 Jan 17
0
[PATCH 1/9] plugins: Move locking to a new file.
...void plugin_config_complete (void);
-extern void plugin_lock_connection (void);
-extern void plugin_unlock_connection (void);
-extern void plugin_lock_request (struct connection *conn);
-extern void plugin_unlock_request (struct connection *conn);
-extern bool plugin_is_parallel (void);
extern int plugin_errno_is_preserved (void);
extern int plugin_open (struct connection *conn, int readonly);
extern void plugin_close (struct connection *conn);
@@ -169,6 +165,14 @@ extern int plugin_flush (struct connection *conn);
extern int plugin_trim (struct connection *conn, uint32_t count, uint64_t offset);
extern int plugi...
2018 Jan 16
0
[PATCH nbdkit 1/3] plugins: Move locking to a new file.
...void plugin_config_complete (void);
-extern void plugin_lock_connection (void);
-extern void plugin_unlock_connection (void);
-extern void plugin_lock_request (struct connection *conn);
-extern void plugin_unlock_request (struct connection *conn);
-extern bool plugin_is_parallel (void);
extern int plugin_errno_is_preserved (void);
extern int plugin_open (struct connection *conn, int readonly);
extern void plugin_close (struct connection *conn);
@@ -169,6 +165,14 @@ extern int plugin_flush (struct connection *conn);
extern int plugin_trim (struct connection *conn, uint32_t count, uint64_t offset);
extern int plugi...
2017 Nov 17
0
[nbdkit PATCH 6/6] Add --threads option for supporting true parallel requests
...atile int quit;
@@ -151,6 +152,7 @@ extern void plugin_lock_connection (void);
extern void plugin_unlock_connection (void);
extern void plugin_lock_request (struct connection *conn);
extern void plugin_unlock_request (struct connection *conn);
+extern bool plugin_is_parallel (void);
extern int plugin_errno_is_preserved (void);
extern int plugin_open (struct connection *conn, int readonly);
extern void plugin_close (struct connection *conn);
diff --git a/src/main.c b/src/main.c
index c9f08ab..cc5e9e3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -84,6 +84,7 @@ int readonly; /* -r */
char *run;...
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 Jan 17
14
[PATCH 0/9] Add filters to nbdkit.
The first three patches are identical to:
https://www.redhat.com/archives/libguestfs/2018-January/msg00079.html
"[PATCH nbdkit v2 0/3] Refactor plugin_* functions into a backend"
The rest of the patches add filters using the new filter API
previously described here:
https://www.redhat.com/archives/libguestfs/2018-January/msg00073.html
This needs a lot more testing -- and tests --
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 Jan 17
0
[PATCH 7/9] Implement filters.
...lly passing through to the final plugin, hence
+ * the function names.
+ */
+static int
+plugin_thread_model (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct backend_filter, backend);
+
+ return f->backend.next->thread_model (f->backend.next);
+}
+
+static int
+plugin_errno_is_preserved (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct backend_filter, backend);
+
+ return f->backend.next->errno_is_preserved (f->backend.next);
+}
+
+static const char *
+plugin_name (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct back...
2018 Jan 19
16
[nbdkit PATCH v2 00/13] Add filters + FUA support to nbdkit
A combination of the work that both Rich and I have been doing
lately, where filters use only the new API with flags on every
command that the client can send over the wire (we can then
add support for more flags in nbdkit without having to add new
callbacks, as NBD adds more flags upstream).
Eric Blake (4):
protocol: Split flags from cmd field in requests
backend: Pass flags argument through
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
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
2017 Nov 20
10
[nbdkit PATCH v2 0/8] Support parallel transactions within single connection
I've posted some of these patches or ideas before; but now I'm
confident enough with the series that it should be ready to push;
at any rate, I can now run test-socket-activation in a tight loop
without triggering any crashes or hangs.
With this in place, I'm going back to work on making the nbd
forwarder wort with the parallel thread model.
Eric Blake (8):
sockets: Use
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...lly passing through to the final plugin, hence
+ * the function names.
+ */
+static int
+plugin_thread_model (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct backend_filter, backend);
+
+ return f->backend.next->thread_model (f->backend.next);
+}
+
+static int
+plugin_errno_is_preserved (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct backend_filter, backend);
+
+ return f->backend.next->errno_is_preserved (f->backend.next);
+}
+
+static const char *
+plugin_name (struct backend *b)
+{
+ struct backend_filter *f = container_of (b, struct back...