search for: filter_init

Displaying 20 results from an estimated 21 matches for "filter_init".

2020 Mar 23
0
[PATCH nbdkit 2/3] server: Inject API functions for Windows
..._init) = dlsym (dl, "plugin_init"); if ((error = dlerror ()) != NULL) { fprintf (stderr, "%s: %s: %s\n", program_name, name, error); @@ -825,6 +885,7 @@ open_filter_so (struct backend *next, size_t i, bool free_filename = false; void *dl; struct nbdkit_filter *(*filter_init) (void); + void *(*functions_init) (struct nbdkit_functions *); char *error; if (short_name) { @@ -846,6 +907,18 @@ open_filter_so (struct backend *next, size_t i, /* Initialize the filter. See dlopen(3) to understand C weirdness. */ dlerror (); +#ifdef WINDOWS_COMPAT + *(void **...
2018 Jan 17
0
[PATCH 7/9] Implement filters.
...ter_pread, + .pwrite = filter_pwrite, + .flush = filter_flush, + .trim = filter_trim, + .zero = filter_zero, +}; + +/* Register and load a filter. */ +struct backend * +filter_register (struct backend *next, size_t index, const char *filename, + void *dl, struct nbdkit_filter *(*filter_init) (void)) +{ + struct backend_filter *f; + const struct nbdkit_filter *filter; + size_t i, len, size; + + f = calloc (1, sizeof *f); + if (f == NULL) { + out_of_memory: + perror ("strdup"); + exit (EXIT_FAILURE); + } + + f->backend = filter_functions; + f->backend.next...
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...quot; +#else +#define NBDKIT_CXX_LANG_C /* nothing */ +#endif +#endif + +#define NBDKIT_REGISTER_FILTER(filter) \ + NBDKIT_CXX_LANG_C \ + struct nbdkit_filter * \ + filter_init (void) \ + { \ + (filter)._struct_size = sizeof (filter); \ + (filter)._api_version = NBDKIT_API_VERSION; \ + return &a...
2018 Jan 19
0
[PATCH nbdkit filters-v3 3/7] Introduce filters.
...void *handle, uint32_t count, uint64_t offset, int may_trim); +}; + +#define NBDKIT_REGISTER_FILTER(filter) \ + NBDKIT_CXX_LANG_C \ + struct nbdkit_filter * \ + filter_init (void) \ + { \ + (filter)._struct_size = sizeof (filter); \ + (filter)._api_version = NBDKIT_FILTER_API_VERSION; \ + return &a...
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 14
10
[PATCH nbdkit INCOMPLETE 0/6] Introduce filters to nbdkit.
This patch isn't complete (patch 6/6 isn't finished) so it's just for discussion, although it does compile and run. This introduces to nbdkit a concept of "filters" which can be placed in front of plugins to modify their behaviour. Some examples where you might use filters: * Serve a subset of the data, such as (offset, range) or a single partition from a disk image.
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
2019 Jan 02
0
[PATCH nbdkit v2 1/2] Annotate internal function parameters with attribute((nonnull)).
...void)) + __attribute__((__nonnull__ (2, 3, 4))); +extern void set_debug_flags (void *dl, const char *name) + __attribute__((__nonnull__ (1, 2))); /* filters.c */ -extern struct backend *filter_register (struct backend *next, size_t index, const char *filename, void *dl, struct nbdkit_filter *(*filter_init) (void)); +extern struct backend *filter_register (struct backend *next, size_t index, + const char *filename, void *dl, + struct nbdkit_filter *(*filter_init) (void)) + __attribute__((__nonnull__ (1, 3, 4, 5))); /* l...
2018 Jan 19
10
[PATCH nbdkit filters-v2 0/5] Introduce filters.
Rebased filters patch. Requires current git master + the locks / thread model fix (https://www.redhat.com/archives/libguestfs/2018-January/msg00128.html) So a few changes here since last time: The "introduce filters" and "implement filters" patches are squashed together. I introduced a concept of .prepare and .finalize. These run before and after the data serving phase
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 --
2019 Jan 02
4
[PATCH nbdkit v2 0/2] Use of attribute(()).
v1 was here: https://www.redhat.com/archives/libguestfs/2019-January/msg00008.html In v2 I have provided two patches: The first patch extends attribute((nonnull)) to most internal functions, but not to the external API. The second patch uses a macro so that attribute((format)) is only used in the public API on GCC or Clang. At least in theory these headers could be used by a C compiler which
2020 Mar 23
0
[PATCH nbdkit 1/3] include: Function indirection for PE DLL
...filter { int *err); }; +#if defined(WINDOWS_COMPAT) +#define NBDKIT_REGISTER_FILTER(filter) \ + NBDKIT_CXX_LANG_C __declspec(dllexport) \ + struct nbdkit_filter * \ + filter_init (void) \ + { \ + (filter)._api_version = NBDKIT_FILTER_API_VERSION; \ + (filter)._version = NBDKIT_VERSION_STRING; \ + return &a...
2019 May 17
0
[nbdkit PATCH 3/3] filters: Use only .thread_model, not THREAD_MODEL
...against * one version of the header with a runtime compiled against a * different version. */ int _api_version; - int _thread_model; /* Because there is no ABI guarantee, new fields may be added * where logically appropriate. */ @@ -178,7 +177,6 @@ struct nbdkit_filter { filter_init (void) \ { \ (filter)._api_version = NBDKIT_FILTER_API_VERSION; \ - (filter)._thread_model = THREAD_MODEL; \ return &a...
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
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
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...filename = true; } dl = dlopen (filename, RTLD_NOW|RTLD_GLOBAL); @@ -780,7 +781,7 @@ open_filter_so (struct backend *next, size_t i, { struct backend *ret; char *filename = (char *) name; - int free_filename = 0; + bool free_filename = false; void *dl; struct nbdkit_filter *(*filter_init) (void); char *error; @@ -792,7 +793,7 @@ open_filter_so (struct backend *next, size_t i, perror ("asprintf"); exit (EXIT_FAILURE); } - free_filename = 1; + free_filename = true; } dl = dlopen (filename, RTLD_NOW|RTLD_GLOBAL); @@ -1023,7 +1024,7 @@ fork...
2019 Aug 30
1
[nbdkit PATCH v2] filters: Stronger version match requirements
...opriate, as long as we correctly bump - * NBDKIT_FILTER_API_VERSION once per stable release. + * logically appropriate. */ const char *name; const char *longname; - const char *version; const char *description; void (*load) (void); @@ -179,6 +180,7 @@ struct nbdkit_filter { filter_init (void) \ { \ (filter)._api_version = NBDKIT_FILTER_API_VERSION; \ + (filter)._version = NBDKIT_VERSION_STRING; \ return &a...
2019 Aug 30
0
[nbdkit PATCH 1/9] server: Fewer dereferences in filter
...lename); + debug ("registering filter %s", filename); /* Call the initialization function which returns the address of the * filter's own 'struct nbdkit_filter'. @@ -866,7 +854,7 @@ filter_register (struct backend *next, size_t index, const char *filename, filter = filter_init (); if (!filter) { fprintf (stderr, "%s: %s: filter registration function failed\n", - program_name, f->filename); + program_name, filename); exit (EXIT_FAILURE); } @@ -887,14 +875,14 @@ filter_register (struct backend *next, size_t index, const...
2018 Jan 16
2
[nbdkit] Proposed (new) filter API
..."C" #else #define NBDKIT_CXX_LANG_C /* nothing */ #endif #endif #define NBDKIT_REGISTER_FILTER(filter) \ NBDKIT_CXX_LANG_C \ struct nbdkit_filter * \ filter_init (void) \ { \ (filter)._struct_size = sizeof (filter); \ (filter)._api_version = NBDKIT_API_VERSION; \ return &(...
2019 May 17
4
[nbdkit PATCH 0/3] Add noparallel filter
Being able to programmatically force nbdkit to be less parallel can be useful during testing. I was less sure about patch 3, but if you like it, I'm inclined to instead squash it into patch 1. This patch is written to apply after my NBD_CMD_CACHE work (since I touched the nocache filter); but can be rearranged if we think this series should go in first while that one undergoes any adjustments