search for: plugin_config_complete

Displaying 20 results from an estimated 33 matches for "plugin_config_complete".

2018 Jan 14
0
[PATCH nbdkit INCOMPLETE 6/6] filters: Implement chain of filters in front of ordinary plugin methods.
...alue); + else { + struct filter *f = data; + + debug ("%s: config key=%s, value=%s", f->filename, key, value); + + if (f->filter.config) + if (f->filter.config (key, value, filter_plugin_config, f->next) == -1) + return -1; + return 0; + } } void -plugin_config_complete (void) +plugin_config (const char *key, const char *value) +{ + if (filter_plugin_config (filters, key, value) == -1) + exit (EXIT_FAILURE); +} + +static int +final_plugin_config_complete (void) { assert (dl); debug ("%s: config_complete", filename); if (!plugin.config_c...
2018 Jan 16
1
Re: [PATCH nbdkit 1/3] plugins: Move locking to a new file.
...S) { > +++ b/src/plugins.c > +int > +plugin_thread_model (void) > +{ > + assert (dl); > + > + return plugin._thread_model; > +} The new code asserts dl prior to locking the connection; > + > const char * > plugin_name (void) > { > @@ -312,67 +316,6 @@ plugin_config_complete (void) > exit (EXIT_FAILURE); > } > > -/* Handle the thread model. */ > -void > -plugin_lock_connection (void) > -{ > - if (plugin._thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS) { > - debug ("%s: acquire connection lock", filename); &...
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.
2016 Sep 27
1
Re: Memory corruption when testing nbdkit python plugin with nbd-tester-client?
...requests only, but it does _not_ lock any other calls into the plugin. Due to that, the following calls are neither locked against each other nor are they locked against client requests: plugin_register (const char *_filename, plugin_cleanup (void) plugin_config (const char *key, const char *value) plugin_config_complete (void) plugin_open (struct connection *conn, int readonly) plugin_close (struct connection *conn) plugin_get_size (struct connection *conn) plugin_can_write (struct connection *conn) plugin_can_flush (struct connection *conn) plugin_is_rotational (struct connection *conn) plugin_can_trim (struct co...
2018 Jan 16
4
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend
v1 -> v2: - Fixed everything mentioned in the review. Rich.
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...d plugin_cleanup (void); -extern int plugin_thread_model (void); -extern const char *plugin_name (void); -extern void plugin_usage (void); -extern const char *plugin_version (void); -extern void plugin_dump_fields (void); -extern void plugin_config (const char *key, const char *value); -extern void plugin_config_complete (void); -extern int plugin_errno_is_preserved (void); -extern int plugin_open (struct connection *conn, int readonly); -extern void plugin_close (struct connection *conn); -extern int64_t plugin_get_size (struct connection *conn); -extern int plugin_can_write (struct connection *conn); -extern int...
2018 Jan 17
0
[PATCH 1/9] plugins: Move locking to a new file.
...d plugin_cleanup (void); +extern int plugin_thread_model (void); extern const char *plugin_name (void); extern void plugin_usage (void); extern const char *plugin_version (void); extern void plugin_dump_fields (void); extern void plugin_config (const char *key, const char *value); extern void plugin_config_complete (void); -extern void plugin_lock_connection (void); -extern void plugin_unlock_connection (void); -extern void plugin_lock_request (struct connection *conn); -extern void plugin_unlock_request (struct connection *conn); -extern bool plugin_is_parallel (void); extern int plugin_errno_is_preserved (...
2018 Jan 16
0
[PATCH nbdkit 1/3] plugins: Move locking to a new file.
...d plugin_cleanup (void); +extern int plugin_thread_model (void); extern const char *plugin_name (void); extern void plugin_usage (void); extern const char *plugin_version (void); extern void plugin_dump_fields (void); extern void plugin_config (const char *key, const char *value); extern void plugin_config_complete (void); -extern void plugin_lock_connection (void); -extern void plugin_unlock_connection (void); -extern void plugin_lock_request (struct connection *conn); -extern void plugin_unlock_request (struct connection *conn); -extern bool plugin_is_parallel (void); extern int plugin_errno_is_preserved (...
2018 Jan 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...d plugin_cleanup (void); -extern int plugin_thread_model (void); -extern const char *plugin_name (void); -extern void plugin_usage (void); -extern const char *plugin_version (void); -extern void plugin_dump_fields (void); -extern void plugin_config (const char *key, const char *value); -extern void plugin_config_complete (void); -extern int plugin_errno_is_preserved (void); -extern int plugin_open (struct connection *conn, int readonly); -extern void plugin_close (struct connection *conn); -extern int64_t plugin_get_size (struct connection *conn); -extern int plugin_can_write (struct connection *conn); -extern int...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...d plugin_cleanup (void); -extern int plugin_thread_model (void); -extern const char *plugin_name (void); -extern void plugin_usage (void); -extern const char *plugin_version (void); -extern void plugin_dump_fields (void); -extern void plugin_config (const char *key, const char *value); -extern void plugin_config_complete (void); -extern int plugin_errno_is_preserved (void); -extern int plugin_open (struct connection *conn, int readonly); -extern void plugin_close (struct connection *conn); -extern int64_t plugin_get_size (struct connection *conn); -extern int plugin_can_write (struct connection *conn); -extern int...
2017 Nov 14
0
[PATCH 2/3] Avoid race conditions when nbdkit exits.
...on_lock); + debug ("%s: unload", filename); if (plugin.unload) plugin.unload (); @@ -163,6 +169,8 @@ plugin_cleanup (void) dl = NULL; free (filename); filename = NULL; + + pthread_rwlock_unlock (&unload_prevention_lock); } } @@ -299,8 +307,6 @@ plugin_config_complete (void) void plugin_lock_connection (void) { - assert (dl); - if (plugin._thread_model <= NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS) { debug ("%s: acquire connection lock", filename); pthread_mutex_lock (&connection_lock); @@ -310,8 +316,6 @@ plugin_lock_connection...
2018 Feb 01
0
[nbdkit PATCH v2 1/3] backend: Rework internal/filter error return semantics
...e = filter_config_complete, - .errno_is_preserved = plugin_errno_is_preserved, .open = filter_open, .prepare = filter_prepare, .finalize = filter_finalize, diff --git a/src/plugins.c b/src/plugins.c index dba3e24..c49c0f0 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -227,14 +227,6 @@ plugin_config_complete (struct backend *b) exit (EXIT_FAILURE); } -static int -plugin_errno_is_preserved (struct backend *b) -{ - struct backend_plugin *p = container_of (b, struct backend_plugin, backend); - - return p->plugin.errno_is_preserved; -} - static int plugin_open (struct backend *b, struct conne...
2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...erve) + return; + + if (p->plugin.ready_to_serve () == -1) + exit (EXIT_FAILURE); +} + static void * plugin_open (struct backend *b, struct connection *conn, int readonly) { @@ -656,6 +671,7 @@ static struct backend plugin_functions = { .config = plugin_config, .config_complete = plugin_config_complete, .magic_config_key = plugin_magic_config_key, + .ready_to_serve = plugin_ready_to_serve, .open = plugin_open, .prepare = plugin_prepare, .finalize = plugin_finalize, diff --git a/tests/test-layers-filter.c b/tests/test-layers-filter.c index d590cf9..315fff3 100644 --- a/tests/test-laye...
2017 Nov 14
7
[PATCH 0/3] Alternate way to avoid race conditions when nbdkit exits.
This fixes the race conditions for me, using the test described here: https://www.redhat.com/archives/libguestfs/2017-September/msg00226.html Rich.
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 --
2020 Feb 22
2
Re: Plans for nbdkit 1.18 release?
Eric: Did you want to take this one any further? It might be one that we save for > 1.18: https://www.redhat.com/archives/libguestfs/2020-February/thread.html#00206 Another thing I've been thinking about for some time is splitting .config_complete into .config_complete + .get_ready (new name TBD). At the moment .config_complete is both the place where we finish processing config, and
2020 Feb 22
1
Re: Plans for nbdkit 1.18 release?
...+ if (!p->plugin.get_ready) + return; + + if (p->plugin.get_ready () == -1) + exit (EXIT_FAILURE); +} + static int plugin_preconnect (struct backend *b, int readonly) { @@ -670,6 +685,7 @@ static struct backend plugin_functions = { .config = plugin_config, .config_complete = plugin_config_complete, .magic_config_key = plugin_magic_config_key, + .get_ready = plugin_get_ready, .preconnect = plugin_preconnect, .open = plugin_open, .prepare = plugin_prepare, diff --git a/tests/test-layers-filter.c b/tests/test-layers-filter.c index 44f62c6e..53427d2a 100644 --- a/tests/test-layers-f...
2018 Sep 07
7
[PATCH nbdkit 0/6] plugins: Implement magic config key.
Remove the need to use file= (and in future other) parameters for many plugins. eg. Using the file plugin becomes: nbdkit file disk.img Rich.
2016 Sep 26
2
Re: Memory corruption when testing nbdkit python plugin with nbd-tester-client?
On 26.09.2016 14:29, Richard W.M. Jones wrote: > On Mon, Sep 26, 2016 at 02:18:02PM +0200, Carl-Daniel Hailfinger wrote: >> Hi, >> >> has anyone ever run "make check" from nbd against nbdkit with a python >> plugin? I usually get segfaults during such a run, and sometimes various >> other errors happen before the segfault, suggesting that some memory
2018 Sep 08
8
[PATCH nbdkit v2 0/6] plugins: Implement magic config key.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-September/msg00024.html v2: - As discussed in the patch review, tighten up the characters permitted in keys. - Update documentation to note that relative paths can be made safe by prefixing with ./ and absolute paths do not need any extra steps. - I pushed patch 1/6 from the v1 series since it was just a trivial