search for: dump_fields

Displaying 20 results from an estimated 29 matches for "dump_fields".

2018 Jan 17
0
[PATCH 4/9] backend: Add a .plugin_name method.
...-154,6 +154,7 @@ struct backend { void (*free) (struct backend *); int (*thread_model) (struct backend *); const char *(*name) (struct backend *); + const char *(*plugin_name) (struct backend *); void (*usage) (struct backend *); const char *(*version) (struct backend *); void (*dump_fields) (struct backend *); diff --git a/src/plugins.c b/src/plugins.c index 6a2ef66..f0fe864 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -465,6 +465,7 @@ static struct backend plugin_functions = { .free = plugin_free, .thread_model = plugin_thread_model, .name = plugin_name, + .plugin_nam...
2018 Jan 16
1
Re: [PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...use global variables. > --- > +struct backend { > + void (*free) (struct backend *); > + int (*thread_model) (struct backend *); > + const char *(*name) (struct backend *); > + void (*usage) (struct backend *); > + const char *(*version) (struct backend *); > + void (*dump_fields) (struct backend *); > + void (*config) (struct backend *, const char *key, const char *value); > + void (*config_complete) (struct backend *); > + int (*errno_is_preserved) (struct backend *); > + int (*open) (struct backend *, struct connection *conn, int readonly); Is it worth u...
2018 Jan 17
2
Re: [PATCH 4/9] backend: Add a .plugin_name method.
...+ b/src/plugins.c > @@ -465,6 +465,7 @@ static struct backend plugin_functions = { > .free = plugin_free, > .thread_model = plugin_thread_model, > .name = plugin_name, > + .plugin_name = plugin_name, > .usage = plugin_usage, > .version = plugin_version, > .dump_fields = plugin_dump_fields, > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
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.
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
2018 Sep 10
7
[PATCH nbdkit v3 0/6] plugins: Implement magic config key.
v1: https://www.redhat.com/archives/libguestfs/2018-September/msg00024.html v2: https://www.redhat.com/archives/libguestfs/2018-September/msg00034.html v3: - Fixed is_config_key zero length test. - Fixed is_config_key so it uses strspn and is not O(n^2). - Changed >= 1.7 to >= 1.8 in the documentation. Rich.
2018 Feb 01
0
[nbdkit PATCH v2 1/3] backend: Rework internal/filter error return semantics
...or (const char *fs, va_list args); + +For convenience, C<nbdkit_error> preserves the value of C<errno>. =head1 DEBUGGING diff --git a/src/internal.h b/src/internal.h index 3cbfde5..2cda390 100644 --- a/src/internal.h +++ b/src/internal.h @@ -176,7 +176,6 @@ struct backend { void (*dump_fields) (struct backend *); void (*config) (struct backend *, const char *key, const char *value); void (*config_complete) (struct backend *); - int (*errno_is_preserved) (struct backend *); int (*open) (struct backend *, struct connection *conn, int readonly); int (*prepare) (struct backend...
2018 Jan 16
0
[PATCH nbdkit 2/3] Refactor plugin_* functions into a backend struct.
...ister (const char *_filename, void *_dl, struct nbdkit_plugin *(*plugin_init) (void)); -extern void 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 pl...
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 17
0
[PATCH 2/9] Refactor plugin_* functions into a backend struct.
...ister (const char *_filename, void *_dl, struct nbdkit_plugin *(*plugin_init) (void)); -extern void 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 pl...
2018 Jan 16
0
[PATCH nbdkit v2 2/3] Refactor plugin_* functions into a backend struct.
...ister (const char *_filename, void *_dl, struct nbdkit_plugin *(*plugin_init) (void)); -extern void 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 pl...
2019 Aug 30
0
[nbdkit PATCH 1/9] server: Fewer dereferences in filter
...- struct backend_filter *f = container_of (b, struct backend_filter, backend); - - return f->backend.next->plugin_name (f->backend.next); + return b->next->plugin_name (b->next); } static const char * @@ -161,9 +159,7 @@ filter_usage (struct backend *b) static void filter_dump_fields (struct backend *b) { - struct backend_filter *f = container_of (b, struct backend_filter, backend); - - f->backend.next->dump_fields (f->backend.next); + b->next->dump_fields (b->next); } static int @@ -183,11 +179,11 @@ filter_config (struct backend *b, const char *key, c...
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.
2018 Jan 17
0
[PATCH 7/9] Implement filters.
...f->filename); + if (f->filter.description) { + printf ("\n"); + printf ("%s\n", f->filter.description); + } + if (f->filter.config_help) { + printf ("\n"); + printf ("%s\n", f->filter.config_help); + } +} + +static void +filter_dump_fields (struct backend *b) +{ + struct backend_filter *f = container_of (b, struct backend_filter, backend); + + f->backend.next->dump_fields (f->backend.next); +} + +static int +next_config (void *nxdata, const char *key, const char *value) +{ + struct backend *b = nxdata; + b->config (b,...
2018 Jan 28
3
[nbdkit PATCH 0/2] RFC: tweak error handling, add log filter
Here's what I'm currently playing with; I'm not ready to commit anything until I rebase my FUA work on top of this, as I only want to break filter ABI once between releases. Eric Blake (2): backend: Rework internal/filter error return semantics filters: Add log filter TODO | 2 - docs/nbdkit-filter.pod | 84 +++++++-- docs/nbdkit.pod
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 Aug 25
0
[nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
...E); - } - top->config (top, keys[optind], p+1); + top->config (top, safekey, p+1); } else if (magic_config_key == NULL) { if (i == 0) /* magic script parameter */ @@ -677,9 +670,7 @@ main (int argc, char *argv[]) if (dump_plugin) { top->dump_fields (top); top->free (top); - for (i = 1; i < argc; ++i) - free (keys[i]); - free (keys); + free_interns (); exit (EXIT_SUCCESS); } @@ -717,9 +708,7 @@ main (int argc, char *argv[]) crypto_free (); close_quit_pipe (); - for (i = 1; i < argc; ++i) - free (...
2020 Aug 27
0
[nbdkit PATCH v2 4/8] api: Add nbdkit_str[n]dup_intern helper
...ILURE); - } - top->config (top, keys[optind], p+1); + top->config (top, key, p+1); } else if (magic_config_key == NULL) { if (i == 0) /* magic script parameter */ @@ -677,9 +669,7 @@ main (int argc, char *argv[]) if (dump_plugin) { top->dump_fields (top); top->free (top); - for (i = 1; i < argc; ++i) - free (keys[i]); - free (keys); + free_interns (); exit (EXIT_SUCCESS); } @@ -717,9 +707,7 @@ main (int argc, char *argv[]) crypto_free (); close_quit_pipe (); - for (i = 1; i < argc; ++i) - free (...
2020 Feb 12
5
[PATCH nbdkit 1/3] server: Rename global backend pointer to "top".
.../* magic config key */ - backend->config (backend, magic_config_key, argv[optind]); + top->config (top, magic_config_key, argv[optind]); } } @@ -643,12 +643,12 @@ main (int argc, char *argv[]) * parameters. */ if (dump_plugin) { - backend->dump_fields (backend); - backend->free (backend); + top->dump_fields (top); + top->free (top); exit (EXIT_SUCCESS); } - backend->config_complete (backend); + top->config_complete (top); /* Select the correct thread model based on config. */ lock_init_thread_model ();...
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