search for: _api_version

Displaying 20 results from an estimated 53 matches for "_api_version".

2019 Aug 30
1
[nbdkit PATCH v2] filters: Stronger version match requirements
We documented our intent of only allowing a filter to run with the same version of nbdkit it was compiled against, but up to now, were not actually enforcing that - we had only been insisting on the looser notion of a matching ._api_version, which doesn't help when we've forgotten to bump that macro when making incompatible API/ABI changes (see commit 6934d4c1). However, we can't use .version (it was documented as optional, so even though all our in-tree filters set it, a theoretical out-of-tree filter could use NULL; and...
2018 Mar 08
0
[nbdkit PATCH v3 15/15] RFC: plugins: Add back-compat for new plugin with old nbdkit
If we bump NBDKIT_API_VERSION, we have forcefully made older nbdkit reject all plugins that opt to the newer API: $ nbdkit ./plugins/nbd/.libs/nbdkit-nbd-plugin.so --dump-plugin nbdkit: ./plugins/nbd/.libs/nbdkit-nbd-plugin.so: plugin is incompatible with this version of nbdkit (_api_version = 2) But with a bit of finesse, we...
2019 Aug 27
3
[nbdkit PATCH 0/2] RFC: tighter filter versions
...d 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 before), but adds the additional requirement that .version match PACKAGE_VERSION from config.h. Then we don't have to hack around ABI changes of the first field member, but are slightly more protected if we forget to bump ._api_version in the future. Eric Blake (2): include: E...
2019 Aug 26
2
[nbdkit PATCH] filters: Bump API version
...filter.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/nbdkit-filter.h b/include/nbdkit-filter.h index 94f17789..1ebd1cb6 100644 --- a/include/nbdkit-filter.h +++ b/include/nbdkit-filter.h @@ -43,7 +43,7 @@ extern "C" { #endif -#define NBDKIT_FILTER_API_VERSION 2 +#define NBDKIT_FILTER_API_VERSION 5 struct nbdkit_extent { uint64_t offset; @@ -100,8 +100,10 @@ struct nbdkit_filter { */ int _api_version; - /* Because there is no ABI guarantee, new fields may be added - * where logically appropriate. */ + /* Because there is no ABI guarante...
2018 Jan 19
0
[nbdkit PATCH v2 13/13] RFC: plugins: Add callbacks for FUA semantics
...+- 5 files changed, 125 insertions(+), 8 deletions(-) diff --git a/docs/nbdkit-plugin.pod b/docs/nbdkit-plugin.pod index 3cafc42..d982e65 100644 --- a/docs/nbdkit-plugin.pod +++ b/docs/nbdkit-plugin.pod @@ -6,6 +6,8 @@ nbdkit-plugin - How to write nbdkit plugins =head1 SYNOPSIS + #define NBDKIT_API_VERSION 2 + #include <nbdkit-plugin.h> #define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS @@ -51,9 +53,21 @@ L<nbdkit-perl-plugin(3)>, L<nbdkit-python-plugin(3)>, L<nbdkit-ruby-plugin(3)>. +=head1 C<#define NBDKIT_API_VERSION> + +Plugins must choose whi...
2018 Jan 18
1
Re: [PATCH 9/9] filters: Move rdelay/wdelay from file plugin to new delay filter.
On Wed, Jan 17, 2018 at 08:01:35PM -0600, Eric Blake wrote: > Actually, thinking about this more: > > When I added zero support, I documented in commit ac3f294a that for the > file plugin, wdelay is indeed doubled on systems lacking efficient zero > support. But the fallback for handling EOPNOTSUPP is currently done at > the plugins.c level (ie. it is part of next->zero()) -
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...uct nbdkit_plugin'. - */ - _plugin = plugin_init (); - if (!_plugin) { - fprintf (stderr, "%s: %s: plugin registration function failed\n", - program_name, filename); - exit (EXIT_FAILURE); - } - - /* Check for incompatible future versions. */ - if (_plugin->_api_version != 1) { - fprintf (stderr, "%s: %s: plugin is incompatible with this version of nbdkit (_api_version = %d)\n", - program_name, filename, _plugin->_api_version); - exit (EXIT_FAILURE); - } - - /* Since the plugin might be much older than the current version of - *...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...sly. */ - _plugin = plugin_init (); - if (!_plugin) { - fprintf (stderr, "%s: %s: plugin registration function failed\n", - program_name, filename); - exit (EXIT_FAILURE); - } + lock_unload (); - /* Check for incompatible future versions. */ - if (_plugin->_api_version != 1) { - fprintf (stderr, "%s: %s: plugin is incompatible with this version of nbdkit (_api_version = %d)\n", - program_name, filename, _plugin->_api_version); - exit (EXIT_FAILURE); - } + debug ("%s: unload", p->filename); + if (p->plugin.unload)...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...uct nbdkit_plugin'. - */ - _plugin = plugin_init (); - if (!_plugin) { - fprintf (stderr, "%s: %s: plugin registration function failed\n", - program_name, filename); - exit (EXIT_FAILURE); - } - - /* Check for incompatible future versions. */ - if (_plugin->_api_version != 1) { - fprintf (stderr, "%s: %s: plugin is incompatible with this version of nbdkit (_api_version = %d)\n", - program_name, filename, _plugin->_api_version); - exit (EXIT_FAILURE); - } + struct backend_plugin *p = container_of (b, struct backend_plugin, backend);...
2018 Mar 08
0
[nbdkit PATCH v3 11/15] plugins: Expose new FUA callbacks
...n without the overhead of an extra flush from nbdkit. diff --git a/docs/nbdkit-plugin.pod b/docs/nbdkit-plugin.pod index 44822fc..933f710 100644 --- a/docs/nbdkit-plugin.pod +++ b/docs/nbdkit-plugin.pod @@ -6,6 +6,8 @@ nbdkit-plugin - How to write nbdkit plugins =head1 SYNOPSIS + #define NBDKIT_API_VERSION 2 + #include <nbdkit-plugin.h> #define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS @@ -63,9 +65,22 @@ L<nbdkit-perl-plugin(3)>, L<nbdkit-python-plugin(3)>, L<nbdkit-ruby-plugin(3)>. +=head1 C<#define NBDKIT_API_VERSION 2> + +Plugins must choose w...
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2: - Fixed everything mentioned in the review. Rich.
2019 Aug 16
0
[nbdkit PATCH 2/2] rust: Add support for dynamic .thread_model
.../lib.rs index 25af2fe6..e369ecbe 100644 --- a/plugins/rust/src/lib.rs +++ b/plugins/rust/src/lib.rs @@ -36,6 +36,7 @@ use std::os::raw::{c_char, c_int, c_void}; // function must return. #[repr(C)] pub struct Plugin { + // Do not modify these three fields directly. _struct_size: u64, _api_version: c_int, _thread_model: c_int, @@ -102,8 +103,11 @@ pub struct Plugin { pub cache: Option<extern fn (h: *mut c_void, count: u32, offset: u64, flags: u32) -> c_int>, + + pub thread_model: Option<extern fn ()...
2018 Mar 20
3
Re: [nbdkit PATCH v3 15/15] RFC: plugins: Add back-compat for new plugin with old nbdkit
On Thu, Mar 08, 2018 at 05:03:11PM -0600, Eric Blake wrote: > If we bump NBDKIT_API_VERSION, we have forcefully made older > nbdkit reject all plugins that opt to the newer API: > > $ nbdkit ./plugins/nbd/.libs/nbdkit-nbd-plugin.so --dump-plugin > nbdkit: ./plugins/nbd/.libs/nbdkit-nbd-plugin.so: plugin is incompatible with this version of nbdkit (_api_version = 2) > >...
2018 Jan 16
6
[PATCH nbdkit 0/3] Refactor plugin_* functions into a backend struct.
Somewhat invasive but mostly mechanical change to how plugins are called. This patch is in preparation for adding a second backend subtype for filters. Rich.
2019 Aug 16
1
Re: [nbdkit PATCH 2/2] rust: Add support for dynamic .thread_model
...--- a/plugins/rust/src/lib.rs > +++ b/plugins/rust/src/lib.rs > @@ -36,6 +36,7 @@ use std::os::raw::{c_char, c_int, c_void}; > // function must return. > #[repr(C)] > pub struct Plugin { > + // Do not modify these three fields directly. > _struct_size: u64, > _api_version: c_int, > _thread_model: c_int, > @@ -102,8 +103,11 @@ pub struct Plugin { > pub cache: Option<extern fn (h: *mut c_void, > count: u32, offset: u64, > flags: u32) -> c_int>, > + > + pub th...
2019 Aug 16
7
[nbdkit PATCH 0/2] rust: Implement some missing v2 callbacks
Similar to what I just did for OCaml (this IS an API break, requiring recompilation of any existing Rust plugin), and done because I want to add fast_zero support to both languages as part of my upcoming fast zero series. Figuring out how to get extents working was hard enough that I punted that, still. Eric Blake (2): rust: Implement can_cache rust: Add support for dynamic .thread_model
2018 Jan 19
2
Re: [nbdkit PATCH v2 13/13] RFC: plugins: Add callbacks for FUA semantics
...ions(-) > > diff --git a/docs/nbdkit-plugin.pod b/docs/nbdkit-plugin.pod > index 3cafc42..d982e65 100644 > --- a/docs/nbdkit-plugin.pod > +++ b/docs/nbdkit-plugin.pod > @@ -6,6 +6,8 @@ nbdkit-plugin - How to write nbdkit plugins > > =head1 SYNOPSIS > > + #define NBDKIT_API_VERSION 2 > + > #include <nbdkit-plugin.h> > > #define THREAD_MODEL NBDKIT_THREAD_MODEL_SERIALIZE_ALL_REQUESTS > @@ -51,9 +53,21 @@ L<nbdkit-perl-plugin(3)>, > L<nbdkit-python-plugin(3)>, > L<nbdkit-ruby-plugin(3)>. > > +=head1 C<#define NBDKIT_AP...
2019 Jun 11
3
[nbdkit PATCH 0/2] Few rust plugin fixups/nitpicks
There are few more things that could be cleaned up related to the coding style and other things, like explicitly specifying the abi style after "extern" (i.e. `extern "C" fn` instead of `extern fn`), but since those are configurable in rustfmt config, I'm not sure whether the config needs to be added or complying with the defaults should be the priority. But this was just
2020 Mar 23
0
[PATCH nbdkit 1/3] include: Function indirection for PE DLL
...LANG_C __declspec(dllexport) \ + struct nbdkit_filter * \ + filter_init (void) \ + { \ + (filter)._api_version = NBDKIT_FILTER_API_VERSION; \ + (filter)._version = NBDKIT_VERSION_STRING; \ + return &(filter); \ + } \ + NBDKIT_CXX_LANG_C _...
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