search for: nbdkit_filt

Displaying 20 results from an estimated 177 matches for "nbdkit_filt".

Did you mean: nbdkit_filter
2019 Aug 30
1
[nbdkit PATCH v2] filters: Stronger version match requirements
...ees for filters, other than - * the ABI position of _api_version that will let us diagnose - * mismatch when the API changes. + * the ABI position and API contents of _api_version and _version to + * diagnose mismatch from the current nbdkit version. */ if (filter->_api_version != NBDKIT_FILTER_API_VERSION) { fprintf (stderr, "%s: %s: filter is incompatible with this version of nbdkit " - "(_api_version = %d)\n", - program_name, filename, filter->_api_version); + "(_api_version = %d, need %d)\n", +...
2019 May 17
0
[nbdkit PATCH 3/3] filters: Use only .thread_model, not THREAD_MODEL
...-function callback. - -If possible filters should be be written to handle fully parallel -requests (C<NBDKIT_THREAD_MODEL_PARALLEL>, even multiple requests -issued in parallel on the same connection). This ensures that they -don't slow down other filters or plugins. - =head1 C<struct nbdkit_filter> All filters must define and register one C<struct nbdkit_filter>, @@ -275,13 +255,27 @@ omit this. int (*thread_model) (void); -This optional function is called after C<.config_complete> to provide -the filter an opportunity to reduce the resulting thread model below -the va...
2020 Aug 27
0
[nbdkit PATCH 1/2] filters: Add .export_description wrappers
...ext2 image", slash, fname); + return nbdkit_strdup_intern (desc); +} + /* Get the disk size. */ static int64_t ext2_get_size (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle) @@ -412,23 +431,24 @@ ext2_flush (struct nbdkit_next_ops *next_ops, void *nxdata, */ static struct nbdkit_filter filter = { - .name = "ext2", - .longname = "nbdkit ext2 filter", - .load = ext2_load, - .unload = ext2_unload, - .config = ext2_config, - .config_complete = ext2_config_complete, - .config_help = ext2_conf...
2020 Mar 23
0
[PATCH nbdkit 1/3] include: Function indirection for PE DLL
...CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef NBDKIT_COMPAT_H +#define NBDKIT_COMPAT_H + +#if !defined (NBDKIT_PLUGIN_H) && !defined (NBDKIT_FILTER_H) +#error this header file should not be directly included +#endif + +#if defined(_WIN32) || defined(__MINGW32__) || defined(__CYGWIN__) || \ + defined(_MSC_VER) +#define WINDOWS_COMPAT +#endif + +struct nbdkit_extents; + +#if defined(WINDOWS_COMPAT) +#include <string.h> +#include <s...
2018 Jan 16
2
[nbdkit] Proposed (new) filter API
...EORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* See nbdkit-filter(3) for documentation and how to write a filter. */ #ifndef NBDKIT_FILTER_H #define NBDKIT_FILTER_H /* This header also defines some useful functions like nbdkit_debug * and nbdkit_parse_size which are appropriate for filters to use. */ #include <nbdkit-plugin.h> #ifdef __cplusplus extern "C" { #endif #define NBDKIT_FILTER_API_VERSION 1 typedef in...
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 Sep 01
1
Re: [nbdkit PATCH 1/2] filters: Add .export_description wrappers
...dkit_strdup_intern (desc); > +} > + > /* Get the disk size. */ > static int64_t > ext2_get_size (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle) > @@ -412,23 +431,24 @@ ext2_flush (struct nbdkit_next_ops *next_ops, void *nxdata, > */ > > static struct nbdkit_filter filter = { > - .name = "ext2", > - .longname = "nbdkit ext2 filter", > - .load = ext2_load, > - .unload = ext2_unload, > - .config = ext2_config, > - .config_complete = ext2_config_complete, &gt...
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1: - rework .can_cache to be tri-state, with default of no advertisement (ripple effect through other patches) - add a lot more patches in order to round out filter support And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so in theory we now have a way to test cache commands through the entire stack. Eric Blake (24): server: Internal hooks for implementing
2019 Aug 27
3
[nbdkit PATCH 0/2] RFC: tighter filter versions
This is not intended for v1.14. In fact, we may decide that the second patch is too gross, although the first one still seems like a useful improvement in isolation. I will also point out that all our filters are in-tree, and set the user-controlled field .version to the current release string. We could replace the second patch with a simpler one that just checks ._api_version as an int (as
2019 Mar 19
0
[PATCH nbdkit 5/9] offset: Implement mapping of extents.
...bdkit_extents_foreach (map2, subtract_offset, extents_map, + NBDKIT_EXTENTS_FOREACH_FLAG_RANGE, + offset, range) == -1) { + nbdkit_extents_free (map2); + return -1; + } + nbdkit_extents_free (map2); + + return 0; +} + static struct nbdkit_filter filter = { .name = "offset", .longname = "nbdkit offset filter", @@ -144,6 +186,7 @@ static struct nbdkit_filter filter = { .pwrite = offset_pwrite, .trim = offset_trim, .zero = offset_zero, + .extents...
2019 Mar 20
0
[PATCH nbdkit 4/8] offset: Implement mapping of extents.
...; ++i) { + e = nbdkit_get_extent (extents2, i); + e.offset -= offset; + if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1) + goto error; + } + nbdkit_extents_free (extents2); + return 0; + + error: + nbdkit_extents_free (extents2); + return -1; +} + static struct nbdkit_filter filter = { .name = "offset", .longname = "nbdkit offset filter", @@ -144,6 +178,7 @@ static struct nbdkit_filter filter = { .pwrite = offset_pwrite, .trim = offset_trim, .zero = offset_zero, + .extents...
2019 Mar 20
0
[PATCH nbdkit 5/8] partition: Implement mapping of extents.
...{ + e = nbdkit_get_extent (extents2, i); + e.offset -= h->offset; + if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1) + goto error; + } + nbdkit_extents_free (extents2); + return 0; + + error: + nbdkit_extents_free (extents2); + return -1; +} + static struct nbdkit_filter filter = { .name = "partition", .longname = "nbdkit partition filter", @@ -237,6 +272,7 @@ static struct nbdkit_filter filter = { .pwrite = partition_pwrite, .trim = partition_trim, .zero = partition_zer...
2019 Mar 26
0
[PATCH nbdkit v4 04/15] blocksize: Implement extents.
...rn less than the full + * count as long as we're making progress. + */ + return next_ops->extents (nxdata, + MIN (count, maxlen), + ROUND_DOWN (offset, minblock), + flags, extents, err); +} + static struct nbdkit_filter filter = { .name = "blocksize", .longname = "nbdkit blocksize filter", @@ -386,6 +404,7 @@ static struct nbdkit_filter filter = { .pwrite = blocksize_pwrite, .trim = blocksize_trim, .zero = blocksize_zer...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 12/19] truncate: Implement extents for beyond end of truncated region.
...nt (extents2); ++i) { + struct nbdkit_extent e = nbdkit_get_extent (extents2, i); + + if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1) { + nbdkit_extents_free (extents2); + return -1; + } + } + nbdkit_extents_free (extents2); + + return 0; +} + static struct nbdkit_filter filter = { .name = "truncate", .longname = "nbdkit truncate filter", @@ -297,6 +351,7 @@ static struct nbdkit_filter filter = { .pwrite = truncate_pwrite, .trim = truncate_trim, .zero = truncate_zero, +...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 11/19] partition: Implement mapping of extents.
...{ + e = nbdkit_get_extent (extents2, i); + e.offset -= h->offset; + if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1) + goto error; + } + nbdkit_extents_free (extents2); + return 0; + + error: + nbdkit_extents_free (extents2); + return -1; +} + static struct nbdkit_filter filter = { .name = "partition", .longname = "nbdkit partition filter", @@ -237,6 +273,7 @@ static struct nbdkit_filter filter = { .pwrite = partition_pwrite, .trim = partition_trim, .zero = partition_zer...
2019 Mar 28
0
[PATCH nbdkit v5 FINAL 10/19] offset: Implement mapping of extents.
...; ++i) { + e = nbdkit_get_extent (extents2, i); + e.offset -= offset; + if (nbdkit_add_extent (extents, e.offset, e.length, e.type) == -1) + goto error; + } + nbdkit_extents_free (extents2); + return 0; + + error: + nbdkit_extents_free (extents2); + return -1; +} + static struct nbdkit_filter filter = { .name = "offset", .longname = "nbdkit offset filter", @@ -144,6 +179,7 @@ static struct nbdkit_filter filter = { .pwrite = offset_pwrite, .trim = offset_trim, .zero = offset_zero, + .extents...
2019 Apr 27
0
[nbdkit PATCH 1/4] filters: Drop useless .open callbacks
..., 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. */ static int64_t cache_get_size (struct nbdkit_next_ops *next_ops, void *nxdata, @@ -476,7 +467,6 @@ static struct nbdkit_filter filter = { .unload = cache_unload, .config = cache_config, .config_complete = cache_config_complete, - .open = cache_open, .prepare = cache_prepare, .get_size = cache_get_size, .pread = cache_pread, diff --git...
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...fig *next, void *nxdata, + const char *key, const char *value) + { + if (strcmp (key, "myparameter") == 0) { + // ... + return 0; + } + else { + // pass through to next filter or plugin + return next (nxdata, key, value); + } + } + + static struct nbdkit_filter filter = { + .name = "filter", + .config = myfilter_config, + /* etc */ + }; + + NBDKIT_REGISTER_FILTER(filter) + +When this has been compiled to a shared library, do: + + nbdkit [--args ...] --filter=./myfilter.so plugin [key=value ...] + +When debugging,...
2020 Mar 23
6
[PATCH nbdkit 0/3] msys2 support for review
I pushed a few of the msys2 patches upstream. I changed the way that $(SHARED_LDFLAGS) works so it's more to my liking, and the others were pushed unchanged. Three patches remain which I'm posting on the mailing list for proper review. Rich.
2018 Jan 19
0
[PATCH nbdkit filters-v3 3/7] Introduce filters.
...fig *next, void *nxdata, + const char *key, const char *value) + { + if (strcmp (key, "myparameter") == 0) { + // ... + return 0; + } + else { + // pass through to next filter or plugin + return next (nxdata, key, value); + } + } + + static struct nbdkit_filter filter = { + .name = "filter", + .config = myfilter_config, + /* etc */ + }; + + NBDKIT_REGISTER_FILTER(filter) + +When this has been compiled to a shared library, do: + + nbdkit [--args ...] --filter=./myfilter.so plugin [key=value ...] + +When debugging,...