Displaying 20 results from an estimated 129 matches for "nbdkit_api_version".
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...
2018 Jan 19
1
Re: [nbdkit PATCH v2 13/13] RFC: plugins: Add callbacks for FUA semantics
On Fri, Jan 19, 2018 at 07:40:29AM -0600, Eric Blake wrote:
> =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 NBDK...
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 19
0
[nbdkit PATCH v2 13/13] RFC: plugins: Add callbacks for FUA semantics
...| 2 +-
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...
2019 Jan 05
0
[PATCH nbdkit v2 07/11] file: Implement NBDKIT_API_VERSION 2.
...++---------------
1 file changed, 42 insertions(+), 20 deletions(-)
diff --git a/plugins/file/file.c b/plugins/file/file.c
index 2a8c9b5..dcff0ee 100644
--- a/plugins/file/file.c
+++ b/plugins/file/file.c
@@ -52,6 +52,8 @@
#include <linux/fs.h> /* For BLKZEROOUT */
#endif
+#define NBDKIT_API_VERSION 2
+
#include <nbdkit-plugin.h>
#include "isaligned.h"
@@ -263,9 +265,30 @@ file_can_trim (void *handle)
#endif
}
+static int
+file_can_fua (void *handle)
+{
+ return NBDKIT_FUA_NATIVE;
+}
+
+/* Flush the file to disk. */
+static int
+file_flush (void *handle, uint32_t flags...
2018 Mar 20
0
Re: [nbdkit PATCH v3 15/15] RFC: plugins: Add back-compat for new plugin with old nbdkit
On 03/20/2018 05:00 AM, Richard W.M. Jones wrote:
> 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...
2020 Apr 09
2
Re: [PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
On 4/9/20 3:36 AM, Richard W.M. Jones wrote:
> The plugin should now support pre-fetch and extents, although most ISO
> images will be non-sparse so extents probably isn't that useful.
True, but it can't hurt ;)
> ---
> plugins/iso/Makefile.am | 4 +-
> plugins/iso/iso.c | 99 +++++++++++++++++++----------------------
> 2 files changed, 48 insertions(+), 55
2018 Mar 08
0
[nbdkit PATCH v3 11/15] plugins: Expose new FUA callbacks
...plugin
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 19
1
Re: [PATCH nbdkit filters-v2 2/5] Introduce filters.
...> + * and nbdkit_parse_size which are appropriate for filters to use.
> + */
> +#include <nbdkit-plugin.h>
Should we stick the useful functions in a new header <nbdkit-common.h>
that both nbdkit-plugin.h and nbdkit-filter.h include? I'm worried that
the games we play with NBDKIT_API_VERSION in nbdkit-plugin.h for
maintaining back-compat there may someday have awkward interactions in
this file.
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#define NBDKIT_FILTER_API_VERSION 1
On the other hand, you're setting NBDKIT_FILTER_API_VERSION separ...
2018 Jan 19
2
Re: [nbdkit PATCH v2 13/13] RFC: plugins: Add callbacks for FUA semantics
...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_AP...
2019 Nov 22
4
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...the API. nbdkit will call this
>>> +# function first to determine which one you want to use. This is the
>>> +# latest version at the time this example was written.
>>> +def api_version():
>>> + return 2
>>
>> Matches the C counterpart of #define NBDKIT_API_VERSION 2 at the top of
>> a plugin.
>
> This is the same thing I was thinking about. This makes it more clear
> that the api
> version is constant, and not something the plugin should change while
> it is being used.
Hmm - api_version() really is constant for the entire life of nbdk...
2020 Apr 09
0
Re: [PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
...ul.
>
> True, but it can't hurt ;)
>
>> ---
>> plugins/iso/Makefile.am | 4 +-
>> plugins/iso/iso.c | 99 +++++++++++++++++++----------------------
>> 2 files changed, 48 insertions(+), 55 deletions(-)
>>
>
Oops, you forgot to set
#define NBDKIT_API_VERSION 2
Maybe in patch 1 you should add this to fileops.h:
#if NBDKIT_API_VERSION - 0 != 2
# error This header requires API version 2
#endif
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
2019 Nov 23
0
[PATCH nbdkit v3 2/7] python: Implement nbdkit API version 2.
...t;C<nbdkit.set_error (errno.EOPNOTSUPP)>>.
=back
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 52eb752..66f9232 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -46,6 +46,8 @@
#define PY_SSIZE_T_CLEAN 1
#include <Python.h>
+#define NBDKIT_API_VERSION 2
+
#include <nbdkit-plugin.h>
#include "cleanup.h"
@@ -60,6 +62,7 @@
*/
static const char *script;
static PyObject *module;
+static int py_api_version = 1;
static int last_error;
@@ -285,9 +288,14 @@ py_dump_plugin (void)
PyObject *fn;
PyObject *r;
+ /* Python...
2019 Nov 22
1
Re: [PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...nction first to determine which one you want to use. This is the
> > >>> +# latest version at the time this example was written.
> > >>> +def api_version():
> > >>> + return 2
> > >>
> > >> Matches the C counterpart of #define NBDKIT_API_VERSION 2 at the top of
> > >> a plugin.
> > >
> > > This is the same thing I was thinking about. This makes it more clear
> > > that the api
> > > version is constant, and not something the plugin should change while
> > > it is being used.
> >...
2020 Apr 10
0
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...WISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+package nbdkit
+
+/*
+#cgo pkg-config: nbdkit
+#cgo LDFLAGS: -Wl,--unresolved-symbols=ignore-in-object-files
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define NBDKIT_API_VERSION 2
+#include <nbdkit-plugin.h>
+
+// cgo cannot call varargs functions.
+void
+_nbdkit_debug (const char *s)
+{
+ nbdkit_debug ("%s", s);
+}
+
+*/
+import "C"
+
+func Debug(s string) {
+ C._nbdkit_debug(C.CString(s))
+}
diff --git a/plugins/golang/test/init.go b/plugins/go...
2018 Mar 08
19
[nbdkit PATCH v3 00/15] Add FUA support to nbdkit
After more than a month since v2 [1], I've finally got my FUA
support series polished. This is all of my outstanding patches,
even though some of them were originally posted in separate
threads from the original FUA post [2], [3]
[1] https://www.redhat.com/archives/libguestfs/2018-January/msg00113.html
[2] https://www.redhat.com/archives/libguestfs/2018-January/msg00219.html
[3]
2019 Nov 22
0
[PATCH nbdkit v2 03/10] python: Implement nbdkit API version 2.
...t;C<nbdkit.set_error (errno.EOPNOTSUPP)>>.
=back
diff --git a/plugins/python/python.c b/plugins/python/python.c
index 69cf4e9..20e05e0 100644
--- a/plugins/python/python.c
+++ b/plugins/python/python.c
@@ -46,6 +46,8 @@
#define PY_SSIZE_T_CLEAN 1
#include <Python.h>
+#define NBDKIT_API_VERSION 2
+
#include <nbdkit-plugin.h>
#include "cleanup.h"
@@ -60,6 +62,7 @@
*/
static const char *script;
static PyObject *module;
+static int py_api_version = 1;
static int last_error;
@@ -356,6 +359,26 @@ py_config (const char *key, const char *value)
&...
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
2020 Apr 10
3
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
Sorry Dan, but I really do dislike golang with a passion :-)
Here is a patch that allows you to write nbdkit plugins in golang. As
with C, OCaml and Rust, you can write a plugin in Go which compiles
directly to a .so file that can be loaded into golang, so in that
sense it works completely differently from scripting language plugins
like Perl and Python where there's an
2019 Mar 29
3
[nbdkit PATCH] protocol: Trivially implement NBD_CMD_FLAG_DF
...s
- online resize.
+* More NBD protocol features. The only currently missing features are
+ sparse reads and online resize.
* Add a callback to let plugins request minimum alignment for the
buffer to pread/pwrite; useful for a plugin utilizing O_DIRECT or
@@ -216,7 +216,11 @@ using ‘#define NBDKIT_API_VERSION <version>’.
* pread could be changed to allow it to support Structured Replies
(SRs). This could mean allowing it to return partial data, holes,
- zeroes, etc.
+ zeroes, etc. For a client that negotiates SR coupled with a plugin
+ that supports .extents, the v2 protocol would allow...