search for: nbdkit_next_config_complete

Displaying 20 results from an estimated 85 matches for "nbdkit_next_config_complete".

2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...f --git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod index 07ede47..4f10494 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -126,8 +126,8 @@ which is required. =head1 NEXT PLUGIN -F<nbdkit-filter.h> defines three function types -(C<nbdkit_next_config>, C<nbdkit_next_config_complete>, +F<nbdkit-filter.h> defines four function types (C<nbdkit_next_config>, +C<nbdkit_next_config_complete>, C<nbdkit_ready_to_serve>, C<nbdkit_next_open>) and a structure called C<struct nbdkit_next_ops>. These abstract the next plugin or filter in the chain....
2020 Aug 07
0
[nbdkit PATCH 2/3] server: Expose final thread_model to filter's .get_ready
...list_get_ready (nbdkit_next_get_ready *next, void *nxdata, + int thread_model) { parse_extentlist (); diff --git a/filters/log/log.c b/filters/log/log.c index f8da9ad8..6a3a9b14 100644 --- a/filters/log/log.c +++ b/filters/log/log.c @@ -100,7 +100,7 @@ log_config_complete (nbdkit_next_config_complete *next, void *nxdata) /* Open the logfile. */ static int -log_get_ready (nbdkit_next_get_ready *next, void *nxdata) +log_get_ready (nbdkit_next_get_ready *next, void *nxdata, int thread_model) { int fd; diff --git a/filters/rate/rate.c b/filters/rate/rate.c index 32c47fdf..325f5657 100644 --...
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 Nov 08
0
[nbdkit PATCH v2 5/5] log: Allow user option of appending to log
...bdkit_next_config *next, void *nxdata, } return 0; } + if (strcmp (key, "logappend") == 0) { + append = nbdkit_parse_bool (value); + if (append < 0) + return -1; + return 0; + } return next (nxdata, key, value); } @@ -86,7 +93,7 @@ log_config_complete (nbdkit_next_config_complete *next, void *nxdata) nbdkit_error ("missing logfile= parameter for the log filter"); return -1; } - logfile = fopen (logfilename, "w"); + logfile = fopen (logfilename, append ? "a" : "w"); if (!logfile) { nbdkit_error ("fopen: %m&q...
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
[nbdkit PATCH 3/3] ext2: Add mode for letting client exportname choose file from image
...01a 100644 --- a/filters/ext2/ext2.c +++ b/filters/ext2/ext2.c @@ -50,7 +50,7 @@ #include "cleanup.h" #include "io.h" -/* Filename parameter. */ +/* Filename parameter, or NULL to honor export name. */ static char *file; static void @@ -94,7 +94,11 @@ ext2_config_complete (nbdkit_next_config_complete *next, void *nxdata) return -1; } - if (file[0] != '/') { + if (strcmp (file, "exportname") == 0) { + free (file); + file = NULL; + } + else if (file[0] != '/') { nbdkit_error ("the file parameter must refer to an absolute path"); ret...
2020 Feb 12
2
[nbdkit PATCH] filters: Remove most next_* wrappers
...e next filter or plugin. + */ +typedef struct backend backend; +#else +typedef void backend; +#endif + /* Next ops. */ -typedef int nbdkit_next_config (void *nxdata, +typedef int nbdkit_next_config (backend *nxdata, const char *key, const char *value); -typedef int nbdkit_next_config_complete (void *nxdata); -typedef int nbdkit_next_preconnect (void *nxdata, int readonly); -typedef int nbdkit_next_open (void *nxdata, int readonly); +typedef int nbdkit_next_config_complete (backend *nxdata); +typedef int nbdkit_next_preconnect (backend *nxdata, int readonly); +typedef int nbdkit_next_ope...
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 Aug 10
2
Re: [nbdkit PATCH 2/3] server: Expose final thread_model to filter's .get_ready
...void *nxdata, > + int thread_model) > { > parse_extentlist (); > > diff --git a/filters/log/log.c b/filters/log/log.c > index f8da9ad8..6a3a9b14 100644 > --- a/filters/log/log.c > +++ b/filters/log/log.c > @@ -100,7 +100,7 @@ log_config_complete (nbdkit_next_config_complete *next, void *nxdata) > > /* Open the logfile. */ > static int > -log_get_ready (nbdkit_next_get_ready *next, void *nxdata) > +log_get_ready (nbdkit_next_get_ready *next, void *nxdata, int thread_model) > { > int fd; > > diff --git a/filters/rate/rate.c b/filters/r...
2019 Aug 28
1
[nbdkit PATCH] offset: Better handling of parameters
...set.c index 7df1ed13..1039a577 100644 --- a/filters/offset/offset.c +++ b/filters/offset/offset.c @@ -64,16 +64,9 @@ offset_config (nbdkit_next_config *next, void *nxdata, return next (nxdata, key, value); } -/* Check the user did pass both parameters. */ -static int -offset_config_complete (nbdkit_next_config_complete *next, void *nxdata) -{ - return next (nxdata); -} - #define offset_config_help \ - "offset=<OFFSET> (required) The start offset to serve.\n" \ - "range=<LENGTH> The total size to serve." + "offset=<OFFSET> The start off...
2020 Feb 22
1
Re: Plans for nbdkit 1.18 release?
...--git a/docs/nbdkit-filter.pod b/docs/nbdkit-filter.pod index 4105b8b7..a9dffb56 100644 --- a/docs/nbdkit-filter.pod +++ b/docs/nbdkit-filter.pod @@ -127,22 +127,24 @@ which is required. =head1 NEXT PLUGIN F<nbdkit-filter.h> defines some function types (C<nbdkit_next_config>, -C<nbdkit_next_config_complete>, C<nbdkit_next_preconnect>, -C<nbdkit_next_open>) and a structure called C<struct nbdkit_next_ops>. -These abstract the next plugin or filter in the chain. There is also -an opaque pointer C<nxdata> which must be passed along when calling -these functions. The value of...
2018 Jan 16
2
[nbdkit] Proposed (new) filter API
...ich are appropriate for filters to use. */ #include <nbdkit-plugin.h> #ifdef __cplusplus extern "C" { #endif #define NBDKIT_FILTER_API_VERSION 1 typedef int (*nbdkit_next_config) (void *nxdata, const char *key, const char *value); typedef int (*nbdkit_next_config_complete) (void *nxdata); struct nbdkit_next { int64_t (*get_size) (void *nxdata); int (*can_write) (void *nxdata); int (*can_flush) (void *nxdata); int (*is_rotational) (void *nxdata); int (*can_trim) (void *nxdata); int (*pread) (void *nxdata, void *buf, uint32_t count, uint64_t offset);...
2018 Nov 08
1
[nbdkit PATCH] log: Allow user option of appending to log
..._config (nbdkit_next_config *next, void *nxdata, } return 0; } + if (strcmp (key, "logappend") == 0) { + append = value[0] && (value[0] != '0' || value[1]); + return 0; + } return next (nxdata, key, value); } @@ -86,7 +92,7 @@ log_config_complete (nbdkit_next_config_complete *next, void *nxdata) nbdkit_error ("missing logfile= parameter for the log filter"); return -1; } - logfile = fopen (logfilename, "w"); + logfile = fopen (logfilename, append ? "a" : "w"); if (!logfile) { nbdkit_error ("fopen: %m&q...
2023 Jun 13
3
[PATCH nbdkit 0/3] tar: Implement tar-limit
This patch series cleans up some issues with nbdkit-tar-filter and (in patch 3) implements a new tar-limit feature which limits how much of the tar file we will read to find the entry within the tar file that we will serve. This protects against the case where a tar file is presented that contains much content at the front that we must iterate over (and download) before we get to the entry we are
2020 Aug 27
4
[nbdkit PATCH 0/2] ext2 export list tweaks
Applies on top of my pending series for the exportname filter, addressing one of the todo's in that cover letter. Eric Blake (2): filters: Add .export_description wrappers ext2: Supply .list_exports and .default_export filters/ext2/nbdkit-ext2-filter.pod | 3 +- tests/Makefile.am | 16 +++- filters/ext2/ext2.c | 125 +++++++++++++++++++---------
2020 Aug 27
0
[nbdkit PATCH 2/2] ext2: Supply .list_exports and .default_export
...ror ("ext2file parameter specified more than once"); return -1; } - file = strdup (value); - if (file == NULL) { - nbdkit_error ("strdup: %m"); - return -1; - } + file = value; return 0; } else @@ -94,10 +86,8 @@ ext2_config_complete (nbdkit_next_config_complete *next, void *nxdata) return -1; } - if (strcmp (file, "exportname") == 0) { - free (file); + if (strcmp (file, "exportname") == 0) file = NULL; - } else if (file[0] != '/') { nbdkit_error ("the file parameter must refer to an absolute pat...
2019 Apr 27
0
[nbdkit PATCH 1/4] filters: Drop useless .open callbacks
...ilters/cache/cache.c | 10 ---------- filters/error/error.c | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/filters/cache/cache.c b/filters/cache/cache.c index b3fef42..19ce555 100644 --- a/filters/cache/cache.c +++ b/filters/cache/cache.c @@ -186,15 +186,6 @@ cache_config_complete (nbdkit_next_config_complete *next, void *nxdata) return next (nxdata); } -static void * -cache_open (nbdkit_next_open *next, void *nxdata, int readonly) -{ - if (next (nxdata, readonly) == -1) - return NULL; - - return NBDKIT_HANDLE_NOT_NEEDED; -} - /* Get the file size and ensure the cache is the correct size. */...
2019 May 16
3
[nbdkit PATCH 0/2] Avoid oddities with files unaligned to granularity
When using a filter that rounds up to alignment boundaries, the tail bytes of the plugin are difficult to access correctly. Rather than duplicating lots of code already in the truncate filter, it's easier to just make the other filters default to rounding down and add doc links on how to round up instead. Eric Blake (2): blocksize: Lift restriction against 0-size file cache, cow: Round
2019 Oct 11
2
Re: [PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...nbdkit to run the recursion itself, instead of requiring the filters to call next_ready_to_serve? > +++ b/tests/test-layers-filter.c > @@ -65,7 +65,7 @@ test_layers_filter_config (nbdkit_next_config *next, void *nxdata, > > static int > test_layers_filter_config_complete (nbdkit_next_config_complete *next, > - void *nxdata) > + void *nxdata) > { > DEBUG_FUNCTION; > return next (nxdata); > @@ -74,6 +74,14 @@ test_layers_filter_config_complete (nbdkit_next_config_complete *next, > #define test...
2020 Aug 07
7
[nbdkit PATCH 0/3] Content differentiation during --tls=on
Patch 3 still needs tests added, but it is at least working from my simple command line tests. Eric Blake (3): server: Implement nbdkit_is_tls for use during .open server: Expose final thread_model to filter's .get_ready tlsdummy: New filter docs/nbdkit-filter.pod | 21 +- docs/nbdkit-plugin.pod | 34 ++- docs/nbdkit-tls.pod