search for: plugin_magic_config_key

Displaying 20 results from an estimated 26 matches for "plugin_magic_config_key".

2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...int (*thread_model) (void); int (*can_fast_zero) (void *handle); + + int (*ready_to_serve) (void); }; extern void nbdkit_set_error (int err); diff --git a/server/filters.c b/server/filters.c index 1ac4a5f..ed00d11 100644 --- a/server/filters.c +++ b/server/filters.c @@ -190,6 +190,29 @@ plugin_magic_config_key (struct backend *b) return b->next->magic_config_key (b->next); } +static int +next_ready_to_serve (void *nxdata) +{ + struct backend *b = nxdata; + b->ready_to_serve (b); + return 0; +} + +static void +filter_ready_to_serve (struct backend *b) +{ + struct backend_filter *f =...
2020 Feb 12
2
Re: [PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...observations in this email: Blake's > https://www.redhat.com/archives/libguestfs/2020-February/msg00092.html > --- > server/filters.c | 217 ++++++++++++++++------------------------------- > 1 file changed, 73 insertions(+), 144 deletions(-) > > @@ -216,201 +205,181 @@ plugin_magic_config_key (struct backend *b) > static int > next_open (void *nxdata, int readonly) > { > - struct b_h *b_h = nxdata; > + struct backend *b_next = nxdata; > > - return backend_open (b_h->b, readonly); > + return backend_open (b_next, readonly); > } With this chan...
2020 Feb 22
2
Re: Plans for nbdkit 1.18 release?
Eric: Did you want to take this one any further? It might be one that we save for > 1.18: https://www.redhat.com/archives/libguestfs/2020-February/thread.html#00206 Another thing I've been thinking about for some time is splitting .config_complete into .config_complete + .get_ready (new name TBD). At the moment .config_complete is both the place where we finish processing config, and
2020 Feb 22
1
Re: Plans for nbdkit 1.18 release?
...FAILURE); + } + else + b->next->get_ready (b->next); +} + static int filter_preconnect (struct backend *b, int readonly) { @@ -493,6 +515,7 @@ static struct backend filter_functions = { .config = filter_config, .config_complete = filter_config_complete, .magic_config_key = plugin_magic_config_key, + .get_ready = filter_get_ready, .preconnect = filter_preconnect, .open = filter_open, .prepare = filter_prepare, diff --git a/server/main.c b/server/main.c index 3bc59781..b3d8e5bf 100644 --- a/server/main.c +++ b/server/main.c @@ -691,6 +691,11 @@ main (int argc, char *argv[]) exi...
2019 Oct 11
3
[PATCH NOT WORKING nbdkit v2 0/2] vddk: Restructure plugin to allow greater parallelism.
This is my second attempt at this. The first version (also not working) was here: https://www.redhat.com/archives/libguestfs/2019-October/msg00062.html In part 1/2 I introduce a new .ready_to_serve plugin method which is called after forking and just before accepting any client connection. The idea would be that plugins could start background threads here. However this doesn't work well in
2020 Feb 12
0
Re: [PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...e's > > >https://www.redhat.com/archives/libguestfs/2020-February/msg00092.html > >--- > > server/filters.c | 217 ++++++++++++++++------------------------------- > > 1 file changed, 73 insertions(+), 144 deletions(-) > > > > >@@ -216,201 +205,181 @@ plugin_magic_config_key (struct backend *b) > > static int > > next_open (void *nxdata, int readonly) > > { > >- struct b_h *b_h = nxdata; > >+ struct backend *b_next = nxdata; > >- return backend_open (b_h->b, readonly); > >+ return backend_open (b_next, readonly); >...
2020 Feb 25
6
[PATCH nbdkit 0/5] server: Add .get_ready callback.
I like this change. I think we were overloading the config_complete method before to do two different things (complete configuration; do any allocation/housekeeping necessary before we can start serving). The only questions in my mind are whether we want this before 1.18, and whether the name ("get_ready") is a good one. Rich.
2018 Sep 07
7
[PATCH nbdkit 0/6] plugins: Implement magic config key.
Remove the need to use file= (and in future other) parameters for many plugins. eg. Using the file plugin becomes: nbdkit file disk.img Rich.
2018 Sep 08
8
[PATCH nbdkit v2 0/6] plugins: Implement magic config key.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-September/msg00024.html v2: - As discussed in the patch review, tighten up the characters permitted in keys. - Update documentation to note that relative paths can be made safe by prefixing with ./ and absolute paths do not need any extra steps. - I pushed patch 1/6 from the v1 series since it was just a trivial
2018 Sep 10
7
[PATCH nbdkit v3 0/6] plugins: Implement magic config key.
v1: https://www.redhat.com/archives/libguestfs/2018-September/msg00024.html v2: https://www.redhat.com/archives/libguestfs/2018-September/msg00034.html v3: - Fixed is_config_key zero length test. - Fixed is_config_key so it uses strspn and is not O(n^2). - Changed >= 1.7 to >= 1.8 in the documentation. Rich.
2019 Oct 11
2
Re: [PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
..._error> > +with an error message and return C<-1>. > + > =head2 C<.open> > > void *open (int readonly); > diff --git a/include/nbdkit-filter.h b/include/nbdkit-filter.h > index c1930c1..7b3a64f 100644 > +++ b/server/filters.c > @@ -190,6 +190,29 @@ plugin_magic_config_key (struct backend *b) > return b->next->magic_config_key (b->next); > } > > +static int > +next_ready_to_serve (void *nxdata) > +{ > + struct backend *b = nxdata; > + b->ready_to_serve (b); > + return 0; > +} > + > +static void > +filter_...
2020 Jun 22
4
[PATCH nbdkit 1/2] server: Add .after_fork callback, mainly for plugins to create threads.
...) == -1) + exit (EXIT_FAILURE); + } + else + b->next->after_fork (b->next); +} + static int filter_preconnect (struct backend *b, int readonly) { @@ -516,6 +538,7 @@ static struct backend filter_functions = { .config_complete = filter_config_complete, .magic_config_key = plugin_magic_config_key, .get_ready = filter_get_ready, + .after_fork = filter_after_fork, .preconnect = filter_preconnect, .open = filter_open, .prepare = filter_prepare, diff --git a/server/main.c b/server/main.c index e9f95380..c432f5bd 100644 --- a/server/main.c +++ b/server/main.c @@ -959,6 +959,7 @@ sta...
2020 Feb 12
2
[nbdkit PATCH] filters: Remove most next_* wrappers
...t;name); if (f->filter.preconnect) - return f->filter.preconnect (next_preconnect, b->next, readonly); + return f->filter.preconnect (b->next->preconnect, b->next, readonly); else return b->next->preconnect (b->next, readonly); } @@ -202,14 +193,6 @@ plugin_magic_config_key (struct backend *b) return b->next->magic_config_key (b->next); } -static int -next_open (void *nxdata, int readonly) -{ - struct backend *b_next = nxdata; - - return backend_open (b_next, readonly); -} - static void * filter_open (struct backend *b, int readonly) { @@ -220,7 +20...
2020 Feb 12
0
[PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...b->name); if (f->filter.preconnect) - return f->filter.preconnect (next_preconnect, &nxdata, readonly); + return f->filter.preconnect (next_preconnect, b->next, readonly); else return b->next->preconnect (b->next, readonly); } @@ -216,201 +205,181 @@ plugin_magic_config_key (struct backend *b) static int next_open (void *nxdata, int readonly) { - struct b_h *b_h = nxdata; + struct backend *b_next = nxdata; - return backend_open (b_h->b, readonly); + return backend_open (b_next, readonly); } static void * filter_open (struct backend *b, int readonly)...
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
It's confusing to use the same terminology for a single backend as for the linked list of backends. In particular it's often not clear if we're calling the next backend or the whole chain of backends. --- server/internal.h | 14 ++++++++++-- server/connections.c | 20 ++++++++--------- server/locks.c | 2 +- server/main.c
2019 Aug 30
0
[nbdkit PATCH 1/9] server: Fewer dereferences in filter
...(EXIT_FAILURE); } else - f->backend.next->config_complete (f->backend.next); + b->next->config_complete (b->next); } /* magic_config_key only applies to plugins, so this passes the @@ -219,9 +215,7 @@ filter_config_complete (struct backend *b) static const char * plugin_magic_config_key (struct backend *b) { - struct backend_filter *f = container_of (b, struct backend_filter, backend); - - return f->backend.next->magic_config_key (f->backend.next); + return b->next->magic_config_key (b->next); } static int @@ -236,7 +230,7 @@ static int filter_open (struc...
2019 Oct 07
6
[nbdkit PATCH 0/5] More retry fixes
I think this is my last round of patches for issues I identified with the retry filter. With this in place, it should be safe to interject another filter in between retry and the plugin. Eric Blake (5): retry: Don't call into closed plugin tests: Refactor test-retry-reopen-fail.sh tests: Enhance retry test to cover failed reopen server: Move prepare/finalize/close recursion to
2020 Jul 31
6
[RFC nbdkit PATCH 0/4] Progress towards .list_exports
This takes Rich's API proposal and starts fleshing it out with enough meat that I was able to test 'nbdkit eval' advertising multiple exports with descriptions paired with 'qemu-nbd --list'. Eric Blake (3): server: Add exports list functions server: Prepare to use export list from plugin sh, eval: Add .list_exports support Richard W.M. Jones (1): server: Implement
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...(conn->exportname_from_set_meta_context); + free (conn->exportname); free (conn->handles); free (conn); threadlocal_set_conn (NULL); diff --git a/server/filters.c b/server/filters.c index 2d705e1e..7d268096 100644 --- a/server/filters.c +++ b/server/filters.c @@ -238,7 +238,7 @@ plugin_magic_config_key (struct backend *b) } static void * -filter_open (struct backend *b, int readonly) +filter_open (struct backend *b, int readonly, const char *exportname) { struct backend_filter *f = container_of (b, struct backend_filter, backend); void *handle; @@ -247,8 +247,8 @@ filter_open (struct b...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...urn f->filter.preconnect (next_preconnect, &nxdata, readonly); else - return b->next->preconnect (b->next, conn, readonly); + return b->next->preconnect (b->next, readonly); } /* magic_config_key only applies to plugins, so this passes the @@ -216,16 +216,16 @@ plugin_magic_config_key (struct backend *b) static int next_open (void *nxdata, int readonly) { - struct b_conn *b_conn = nxdata; + struct b_h *b_h = nxdata; - return backend_open (b_conn->b, b_conn->conn, readonly); + return backend_open (b_h->b, readonly); } static void * -filter_open (struct backe...