search for: dump_plugin

Displaying 20 results from an estimated 92 matches for "dump_plugin".

2018 Oct 01
2
[PATCH nbdkit] plugins: Add scripting language version to --dump-plugin output.
...+++++++++++++ plugins/tcl/tcl.c | 8 ++++++++ 5 files changed, 45 insertions(+) diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c index a73a4da..2bad44c 100644 --- a/plugins/lua/lua.c +++ b/plugins/lua/lua.c @@ -102,6 +102,17 @@ function_defined (const char *name) static void lua_plugin_dump_plugin (void) { +#ifdef LUA_VERSION_MAJOR + printf ("lua_version=%s", LUA_VERSION_MAJOR); +#ifdef LUA_VERSION_MINOR + printf (".%s", LUA_VERSION_MINOR); +#ifdef LUA_VERSION_RELEASE + printf (".%s", LUA_VERSION_RELEASE); +#endif +#endif + printf ("\n"); +#endif...
2018 Mar 06
1
[PATCH nbdkit] Fix --dump-plugin on perl, python and ruby plugins.
...rl/perl.c | 2 +- plugins/python/python.c | 2 +- plugins/ruby/ruby.c | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/perl/perl.c b/plugins/perl/perl.c index 80e5695..8d35b85 100644 --- a/plugins/perl/perl.c +++ b/plugins/perl/perl.c @@ -169,7 +169,7 @@ perl_dump_plugin (void) { dSP; - if (callback_defined ("dump_plugin")) { + if (script && callback_defined ("dump_plugin")) { ENTER; SAVETMPS; PUSHMARK (SP); diff --git a/plugins/python/python.c b/plugins/python/python.c index b105e53..83a32ea 100644 --- a/plugins/p...
2019 Sep 20
0
[PATCH v4 07/12] v2v: nbdkit: Add the readahead filter unconditionally if it is available.
...age. --- v2v/nbdkit.ml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/v2v/nbdkit.ml b/v2v/nbdkit.ml index 4bbb8f043..b2d77f963 100644 --- a/v2v/nbdkit.ml +++ b/v2v/nbdkit.ml @@ -49,6 +49,9 @@ type t = { (* nbdkit plugin_name --dump-plugin output. *) dump_plugin : (string * string) list; + + (* nbdkit directory containing the filters. *) + filterdir : string; } (* Check that nbdkit is available and new enough. *) @@ -105,6 +108,12 @@ let common_create plugin_name plugin_args plugin_env = error_unless_nbdkit_min_version dump_config; error_unless...
2018 Jan 16
0
Re: [nbdkit PATCH 0/7] Initial implementation of FUA flag passthrough
...int (*pwrite_old1) (void *handle, const void *buf, uint32_t count, uint64_t offset); int (*flush) (void *handle); int (*trim) (void *handle, uint32_t count, uint64_t offset); int (*zero) (void *handle, uint32_t count, uint64_t offset, int may_trim); int errno_is_preserved; void (*dump_plugin) (void); + int (*pwrite) (void *handle, const void *buf, uint32_t count, uint64_t offset, unsigned flags); This is binary-compatible with old plugins, but not source compatible, so: (2) Plugsin may optionally define NBDKIT_PLUGIN_LEVEL before including <nbdkit-plugin.h>. Code wishing...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...+ =item Resize Extension I<Not supported>. diff --git a/plugins/eval/nbdkit-eval-plugin.pod b/plugins/eval/nbdkit-eval-plugin.pod index eb3c7f5a..22167ec5 100644 --- a/plugins/eval/nbdkit-eval-plugin.pod +++ b/plugins/eval/nbdkit-eval-plugin.pod @@ -100,6 +100,8 @@ features): =item B<dump_plugin=>SCRIPT +=item B<export_description=>SCRIPT + =item B<extents=>SCRIPT =item B<flush=>SCRIPT diff --git a/plugins/sh/nbdkit-sh-plugin.pod b/plugins/sh/nbdkit-sh-plugin.pod index 17a1f08c..41ceeb1b 100644 --- a/plugins/sh/nbdkit-sh-plugin.pod +++ b/plugins/sh/nbdkit-sh-plugin...
2020 Apr 14
0
[nbdkit PATCH v2 3/3] server: More tests of stdin/out handling
...st-stdio.err + test-stdio.pid1 test-stdio.pid2 $sock1 $sock2" +rm -f $files +cleanup_fn rm -f $files + +# Using a seekable file lets us prove that if the plugin consumes less +# than the full input, the next process sees the rest +cat >test-stdio.in <<EOF +string1 +string2 +EOF + +# .dump_plugin using stdout is normal; using stdin is odd, but viable +{ nbdkit --dump-plugin $plugin; printf 'rest='; cat +} < test-stdio.in > test-stdio.out +grep "input=string1" test-stdio.out +grep "rest=string2" test-stdio.out + +# Test with --run. +nbdkit -v $plugin one=1 -...
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
.../* True if we forked into the background (used to control log messages). */ -int forked_into_background; +bool forked_into_background; /* The currently loaded plugin. */ struct backend *backend; @@ -160,8 +161,8 @@ int main (int argc, char *argv[]) { int c; - int help = 0, version = 0, dump_plugin = 0; - int tls_set_on_cli = 0; + bool help = false, version = false, dump_plugin = false; + int tls_set_on_cli = false; int short_name; const char *filename; char *p; @@ -229,7 +230,7 @@ main (int argc, char *argv[]) flag->flag = strndup (p, q-p-1); if (!flag->fl...
2020 Feb 13
2
[nbdkit PATCH] vddk: Make 'file=' a magic key
...ameters are supported, see nbdkit-vddk-plugin(3)." static void @@ -901,6 +901,7 @@ static struct nbdkit_plugin plugin = { .config = vddk_config, .config_complete = vddk_config_complete, .config_help = vddk_config_help, + .magic_config_key = "file", .dump_plugin = vddk_dump_plugin, .open = vddk_open, .close = vddk_close, diff --git a/tests/test-vddk.sh b/tests/test-vddk.sh index d99ebf88..6933f716 100755 --- a/tests/test-vddk.sh +++ b/tests/test-vddk.sh @@ -48,8 +48,7 @@ grep ^vddk_default_libdir= test-vddk.out # a loa...
2019 Sep 20
4
Re: [PATCH v4 07/12] v2v: nbdkit: Add the readahead filter unconditionally if it is available.
...++++++++- > 1 file changed, 18 insertions(+), 1 deletion(-) > >diff --git a/v2v/nbdkit.ml b/v2v/nbdkit.ml >index 4bbb8f043..b2d77f963 100644 >--- a/v2v/nbdkit.ml >+++ b/v2v/nbdkit.ml >@@ -49,6 +49,9 @@ type t = { > > (* nbdkit plugin_name --dump-plugin output. *) > dump_plugin : (string * string) list; >+ >+ (* nbdkit directory containing the filters. *) >+ filterdir : string; > } > > (* Check that nbdkit is available and new enough. *) >@@ -105,6 +108,12 @@ let common_create plugin_name plugin_args plugin_env = > error_unless_nbdkit_min_versi...
2018 Jun 28
1
[nbdkit PATCH] main: More idiomatic use of getopt_long
.... * * Redistribution and use in source and binary forms, with or without @@ -109,44 +109,55 @@ struct backend *backend; static char *random_fifo_dir = NULL; static char *random_fifo = NULL; -enum { HELP_OPTION = CHAR_MAX + 1 }; +enum { + HELP_OPTION = CHAR_MAX + 1, + DUMP_CONFIG_OPTION, + DUMP_PLUGIN_OPTION, + EXIT_WITH_PARENT_OPTION, + FILTER_OPTION, + RUN_OPTION, + SELINUX_LABEL_OPTION, + TLS_OPTION, + TLS_CERTIFICATES_OPTION, + TLS_VERIFY_PEER_OPTION, +}; static const char *short_options = "e:fg:i:nop:P:rst:u:U:vV"; static const struct option long_options[] = { - { &quot...
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...9;=')) == NULL) { - plugin_config ("script", argv[optind]); + backend->config (backend, "script", argv[optind]); ++optind; } @@ -528,14 +531,14 @@ main (int argc, char *argv[]) * script=... parameter (and do not wait for config_complete). */ if (dump_plugin) { - plugin_dump_fields (); + backend->dump_fields (backend); exit (EXIT_SUCCESS); } while (optind < argc) { if ((p = strchr (argv[optind], '=')) != NULL) { *p = '\0'; - plugin_config (argv[optind], p+1); + backend->config (backend,...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...9;=')) == NULL) { - plugin_config ("script", argv[optind]); + backend->config (backend, "script", argv[optind]); ++optind; } @@ -528,14 +531,14 @@ main (int argc, char *argv[]) * script=... parameter (and do not wait for config_complete). */ if (dump_plugin) { - plugin_dump_fields (); + backend->dump_fields (backend); exit (EXIT_SUCCESS); } while (optind < argc) { if ((p = strchr (argv[optind], '=')) != NULL) { *p = '\0'; - plugin_config (argv[optind], p+1); + backend->config (backend,...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...9;=')) == NULL) { - plugin_config ("script", argv[optind]); + backend->config (backend, "script", argv[optind]); ++optind; } @@ -528,14 +531,14 @@ main (int argc, char *argv[]) * script=... parameter (and do not wait for config_complete). */ if (dump_plugin) { - plugin_dump_fields (); + backend->dump_fields (backend); exit (EXIT_SUCCESS); } while (optind < argc) { if ((p = strchr (argv[optind], '=')) != NULL) { *p = '\0'; - plugin_config (argv[optind], p+1); + backend->config (backend,...
2018 Jul 01
2
[PATCH nbdkit] Add Tcl plugin, for writing plugins in Tcl.
...raw -a nbd://localhost +# ><fs> run +# ><fs> part-disk /dev/sda mbr +# ><fs> mkfs ext2 /dev/sda1 +# ><fs> list-filesystems +# ><fs> mount /dev/sda1 / +# ><fs> [etc] + +# This is called from: nbdkit tcl example.tcl --dump-plugin +proc dump_plugin {} { + puts "example_tcl=1" +} + +# We expect a file=... parameter pointing to the file to serve. +proc config {key value} { + global file + + if { $key == "file" } { + set file $value + } else { + error "unknown parameter $key=$value" + }...
2020 Apr 04
0
[nbdkit PATCH 1/2] server: Add nbdkit_stdio_safe
...to work. It would be nice to fail such usage as soon as possible, by giving plugins a means to decide if it is safe to use stdio during .config. Update nbdkit_read_password and the sh plugin to take advantage of the new entry point. Also, treat 'nbdkit -s --dump-plugin' as an error, as .dump_plugin is supposed to interact with stdout. Signed-off-by: Eric Blake <eblake@redhat.com> --- docs/nbdkit-plugin.pod | 23 ++++++++++++++++++++++- plugins/sh/nbdkit-sh-plugin.pod | 4 +++- include/nbdkit-common.h | 2 ++ server/main.c | 5 +++-- server/nbdkit....
2020 Sep 01
0
[nbdkit PATCH 1/2] python: Implement .list_exports and friends
...ODEL_PARALLEL static struct nbdkit_plugin plugin = { - .name = "python", - .version = PACKAGE_VERSION, + .name = "python", + .version = PACKAGE_VERSION, - .load = py_load, - .unload = py_unload, - .dump_plugin = py_dump_plugin, + .load = py_load, + .unload = py_unload, + .dump_plugin = py_dump_plugin, - .config = py_config, - .config_complete = py_config_complete, - .config_help = py_config_help, + .config = py_config, + .conf...
2018 Jan 14
0
[PATCH nbdkit INCOMPLETE 6/6] filters: Implement chain of filters in front of ordinary plugin methods.
...rc/plugins.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/src/plugins.c b/src/plugins.c index 3600293..085366b 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -406,8 +406,8 @@ plugin_dump_fields (void) plugin.dump_plugin (); } -void -plugin_config (const char *key, const char *value) +static int +final_plugin_config (const char *key, const char *value) { assert (dl); @@ -422,21 +422,68 @@ plugin_config (const char *key, const char *value) exit (EXIT_FAILURE); } - if (plugin.config (key, value) =...
2020 Jun 22
0
[PATCH nbdkit 2/2] vddk: Defer library initialization to .after_fork().
...nitEx", @@ -457,10 +476,6 @@ vddk_get_ready (void) return 0; } -#define vddk_config_help \ - "[file=]<FILENAME> (required) The filename (eg. VMDK file) to serve.\n" \ - "Many optional parameters are supported, see nbdkit-vddk-plugin(3)." - static void vddk_dump_plugin (void) { @@ -959,6 +974,7 @@ static struct nbdkit_plugin plugin = { .magic_config_key = "file", .dump_plugin = vddk_dump_plugin, .get_ready = vddk_get_ready, + .after_fork = vddk_after_fork, .open = vddk_open, .close = vddk_c...
2020 Jul 01
0
[PATCH nbdkit 8/9] nbd: Fix shared=true so it creates background thread after fork.
...handle (false)) == NULL) return -1; return 0; @@ -858,6 +865,7 @@ static struct nbdkit_plugin plugin = { .config_complete = nbdplug_config_complete, .config_help = nbdplug_config_help, .magic_config_key = "uri", + .after_fork = nbdplug_after_fork, .dump_plugin = nbdplug_dump_plugin, .open = nbdplug_open, .close = nbdplug_close, -- 2.25.0
2020 Apr 04
6
[nbdkit PATCH 0/2] stdin/out cleanups
This is what I've been playing with in response to my earlier question about what to do with 'nbdkit -s sh -' (https://www.redhat.com/archives/libguestfs/2020-April/msg00032.html) I'm still open to ideas on a better name, and/or whether adding <stdbool.h> to our public include files is a good idea (if not, returning int instead of bool is tolerable). Eric Blake (2):