Displaying 20 results from an estimated 26 matches for "for_each_backend".
2018 Jan 18
0
Re: [PATCH 4/9] backend: Add a .plugin_name method.
...t independent version numbers (via .version) for the
> filter, compared to the version of the underlying plugin (via
> .plugin_version)?
As it currently stands it's not necessary because main.c does:
if (version) {
const char *v;
struct backend *b;
display_version ();
for_each_backend (b) {
printf ("%s", b->name (b));
if ((v = b->version (b)) != NULL)
printf (" %s", v);
printf ("\n");
}
exit (EXIT_SUCCESS);
}
with the output:
$ ./nbdkit --filter offset --filter delay file --version
nbdkit 1.1.26
offset 1.1...
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
...s(+), 57 deletions(-)
diff --git a/server/internal.h b/server/internal.h
index 45ac60ad..c3622671 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -118,8 +118,18 @@ extern char *unixsocket;
extern const char *user, *group;
extern bool verbose;
-extern struct backend *backend;
-#define for_each_backend(b) for (b = backend; b != NULL; b = b->next)
+/* Linked list of backends. Each backend struct is followed by either
+ * a filter or plugin struct. "top" points to the first one. They
+ * are linked through the backend->next field.
+ *
+ * ┌──────────┐ ┌──────────┐ ┌...
2019 Sep 19
1
[PATCH nbdkit] server: Remove tricksy initialization of struct b_conn_handle.
...7b8..ec28815 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -269,9 +269,8 @@ new_connection (int sockin, int sockout, int nworkers)
goto error;
}
conn->nr_handles = backend->i + 1;
- memset (conn->handles, -1, conn->nr_handles * sizeof *conn->handles);
for_each_backend (b)
- conn->handles[b->i].handle = NULL;
+ reset_b_conn_handle (&conn->handles[b->i]);
conn->status = 1;
conn->nworkers = nworkers;
diff --git a/server/internal.h b/server/internal.h
index c31bb34..604dd89 100644
--- a/server/internal.h
+++ b/server/internal.h
@@...
2018 Jan 17
2
Re: [PATCH 4/9] backend: Add a .plugin_name method.
On 01/17/2018 02:53 PM, Richard W.M. Jones wrote:
> This returns the plugin name, which for plugins is the same as the
> ordinary .name method (but for filters will be different).
> ---
Just as .name and .plugin_name can differ for filters, should we also
have a way to report independent version numbers (via .version) for the
filter, compared to the version of the underlying plugin (via
2018 Jan 17
0
[PATCH 7/9] Implement filters.
..., with or without
@@ -41,6 +41,7 @@
#include <pthread.h>
#include "nbdkit-plugin.h"
+#include "nbdkit-filter.h"
#ifdef __APPLE__
#define UNIX_PATH_MAX 104
@@ -115,6 +116,7 @@ extern volatile int quit;
extern int quit_fd;
extern struct backend *backend;
+#define for_each_backend(b) for (b = backend; b != NULL; b = b->next)
/* cleanup.c */
extern void cleanup_free (void *ptr);
@@ -149,8 +151,19 @@ extern int crypto_negotiate_tls (struct connection *conn, int sockin, int sockou
/* errors.c */
#define debug nbdkit_debug
-/* plugins.c */
struct backend {
+ /* Next...
2019 Aug 30
0
[nbdkit PATCH 5/9] server: Cache per-connection size
...struct connection *conn;
int opt;
socklen_t optlen = sizeof opt;
+ struct backend *b;
conn = calloc (1, sizeof *conn);
if (conn == NULL) {
@@ -273,6 +274,8 @@ new_connection (int sockin, int sockout, int nworkers)
return NULL;
}
conn->nr_handles = backend->i + 1;
+ for_each_backend (b)
+ conn->handles[b->i].exportsize = -1;
conn->status = 1;
conn->nworkers = nworkers;
diff --git a/server/protocol-handshake-newstyle.c b/server/protocol-handshake-newstyle.c
index 28817317..23579e5d 100644
--- a/server/protocol-handshake-newstyle.c
+++ b/server/protocol-han...
2020 Feb 12
0
[PATCH nbdkit 2/3] server: Rename ‘struct b_conn_handle’ to plain ‘struct handle’.
...d *
-connection_get_handle (size_t i)
-{
- GET_CONN;
-
- assert (i < conn->nr_handles);
- return conn->handles[i].handle;
-}
-
int
connection_get_status (void)
{
@@ -258,7 +249,7 @@ new_connection (int sockin, int sockout, int nworkers)
}
conn->nr_handles = top->i + 1;
for_each_backend (b)
- reset_b_conn_handle (&conn->handles[b->i]);
+ reset_handle (get_handle (conn, b->i));
conn->status = 1;
conn->nworkers = nworkers;
--
2.25.0
2020 Aug 25
0
[nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
...tions.c
@@ -360,7 +360,7 @@ free_connection (struct connection *conn)
pthread_mutex_destroy (&conn->status_lock);
free (conn->exportname_from_set_meta_context);
- free (conn->exportname);
+ free_interns ();
/* This is needed in order to free a field in struct handle. */
for_each_backend (b)
diff --git a/server/main.c b/server/main.c
index 17c4c324..9cb12b59 100644
--- a/server/main.c
+++ b/server/main.c
@@ -631,15 +631,9 @@ main (int argc, char *argv[])
*
* Keys must live for the life of nbdkit. Since we want to avoid
* modifying argv (so that /proc/PID/cmdline remain...
2020 Aug 27
0
[nbdkit PATCH v2 4/8] api: Add nbdkit_str[n]dup_intern helper
...tions.c
@@ -360,7 +360,7 @@ free_connection (struct connection *conn)
pthread_mutex_destroy (&conn->status_lock);
free (conn->exportname_from_set_meta_context);
- free (conn->exportname);
+ free_interns ();
/* This is needed in order to free a field in struct handle. */
for_each_backend (b)
diff --git a/server/main.c b/server/main.c
index 17c4c324..ae552447 100644
--- a/server/main.c
+++ b/server/main.c
@@ -631,15 +631,9 @@ main (int argc, char *argv[])
*
* Keys must live for the life of nbdkit. Since we want to avoid
* modifying argv (so that /proc/PID/cmdline remain...
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...rify_peer;
+extern bool tls_verify_peer;
extern char *unixsocket;
-extern int verbose;
-extern int threads;
+extern bool verbose;
extern volatile int quit;
extern int quit_fd;
-extern int forked_into_background;
+extern bool forked_into_background;
extern struct backend *backend;
#define for_each_backend(b) for (b = backend; b != NULL; b = b->next)
@@ -140,7 +140,7 @@ extern void connection_set_close (struct connection *, connection_close_function
/* crypto.c */
#define root_tls_certificates_dir sysconfdir "/pki/" PACKAGE_NAME
-extern void crypto_init (int tls_set_on_cli);
+extern...
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...b/src/internal.h
@@ -41,6 +41,7 @@
#include <pthread.h>
#include "nbdkit-plugin.h"
+#include "nbdkit-filter.h"
#ifdef __APPLE__
#define UNIX_PATH_MAX 104
@@ -118,6 +119,7 @@ extern volatile int quit;
extern int quit_fd;
extern struct backend *backend;
+#define for_each_backend(b) for (b = backend; b != NULL; b = b->next)
/* cleanup.c */
extern void cleanup_free (void *ptr);
@@ -152,8 +154,19 @@ extern int crypto_negotiate_tls (struct connection *conn, int sockin, int sockou
/* errors.c */
#define debug nbdkit_debug
-/* plugins.c */
struct backend {
+ /* Next...
2018 Jan 19
0
[PATCH nbdkit filters-v3 3/7] Introduce filters.
...b/src/internal.h
@@ -41,6 +41,7 @@
#include <pthread.h>
#include "nbdkit-plugin.h"
+#include "nbdkit-filter.h"
#ifdef __APPLE__
#define UNIX_PATH_MAX 104
@@ -118,6 +119,7 @@ extern volatile int quit;
extern int quit_fd;
extern struct backend *backend;
+#define for_each_backend(b) for (b = backend; b != NULL; b = b->next)
/* cleanup.c */
extern void cleanup_free (void *ptr);
@@ -152,8 +154,19 @@ extern int crypto_negotiate_tls (struct connection *conn, int sockin, int sockou
/* errors.c */
#define debug nbdkit_debug
-/* plugins.c */
struct backend {
+ /* Next...
2019 Nov 04
3
[PATCH nbdkit v2 0/2] Implement fuzzing using Clang's libFuzzer.
v1 was here:
https://www.redhat.com/archives/libguestfs/2019-November/msg00003.html
This version depends on:
https://www.redhat.com/archives/libguestfs/2019-November/msg00004.html
and this series:
https://www.redhat.com/archives/libguestfs/2019-November/msg00009.html
The delta has been reduced slightly because of changes made possible
by cleaning up and fixing the quit path in nbdkit. It's
2019 Nov 02
2
[PATCH nbdkit 0/2] Implement fuzzing using Clang's libFuzzer.
libFuzzer is Clang's fuzzer, and alternative to using AFL:
https://llvm.org/docs/LibFuzzer.html
I implemented an alternative method of fuzzing for libnbd earlier
today and it's pretty simple:
https://github.com/libguestfs/libnbd/commit/c19a6fbae9a21a7d4693418706c59e81ed256875
However it's considerably more difficult to use libFuzzer with
non-library code -- in this case nbdkit.
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...d..7609e9a7 100644
--- a/server/connections.c
+++ b/server/connections.c
@@ -274,8 +274,9 @@ new_connection (int sockin, int sockout, int nworkers)
return NULL;
}
conn->nr_handles = backend->i + 1;
+ memset (conn->handles, -1, conn->nr_handles * sizeof *conn->handles);
for_each_backend (b)
- conn->handles[b->i].exportsize = -1;
+ conn->handles[b->i].handle = NULL;
conn->status = 1;
conn->nworkers = nworkers;
diff --git a/server/plugins.c b/server/plugins.c
index d1654f8d..c8f4af90 100644
--- a/server/plugins.c
+++ b/server/plugins.c
@@ -509,7 +509,7...
2020 Aug 25
0
[nbdkit PATCH 1/5] api: Add .default_export
...++nr_options) {
CLEANUP_FREE char *data = NULL;
@@ -445,6 +446,12 @@ negotiate_handshake_newstyle_options (void)
return -1;
conn->using_tls = true;
debug ("using TLS on this connection");
+ /* Wipe out any cached default export name. */
+ for_each_backend (b) {
+ struct handle *h = get_handle (conn, b->i);
+ free (h->default_exportname);
+ h->default_exportname = NULL;
+ }
}
break;
diff --git a/plugins/ondemand/ondemand.c b/plugins/ondemand/ondemand.c
index f9d73ca6..5bd0ee70 100644
--- a/plu...
2019 Aug 30
3
[nbdkit PATCH v2 0/2] caching .can_write
This is a subset of the last half of the larger 9-patch series. The
uncontroversial first half of that series is pushed, but here, I tried
to reduce the size of the patches by splitting out some of the more
complex changes, so that the rest of the changes remaining in the
series are more mechanical. In turn, it forced me to write timing
tests, which let me spot another spot where we are wasting
2019 Aug 30
0
[nbdkit PATCH 2/9] server: Consolidate common backend tasks into new backend.c
...debug ("%s: load", f->backend.name);
if (f->filter.load)
f->filter.load ();
diff --git a/server/main.c b/server/main.c
index 124e19b7..6999818c 100644
--- a/server/main.c
+++ b/server/main.c
@@ -602,7 +602,7 @@ main (int argc, char *argv[])
display_version ();
for_each_backend (b) {
- printf ("%s", b->name (b));
+ printf ("%s", b->name);
if ((v = b->version (b)) != NULL)
printf (" %s", v);
printf ("\n");
diff --git a/server/plugins.c b/server/plugins.c
index 34cc3cb5..0f70ede0 100644
--- a/...
2020 Aug 25
9
[nbdkit PATCH 0/5] Implement .default_export, nbdkit_string_intern
More patches on the way for improving .list_exports signature and
adding .export_description, but this is the promised code showing
why nbdkit_string_intern is useful. Patch 4 is somewhat RFC: we
could either add new API to take the boilerplate from:
foo_config(const char *key, const char *value) {
if (strcmp (key, "file") == 0) {
CLEANUP_FREE char *tmp = nbdkit_realpath (value);
2018 Jan 19
9
[PATCH nbdkit filters-v3 0/7] Introduce filters.
This is still tentative and needs a lot of work, but:
- partition filter works, supporting MBR & GPT
- prepare and finalize methods fixed
- open method can now be changed (allowing readonly flag to be modified)
- thread_model can be limited
I believe I made most of the changes which were previously suggested
in email. I think the only one I didn't was preventing inclusion of
both