search for: nbdkit_exports_new

Displaying 17 results from an estimated 17 matches for "nbdkit_exports_new".

2020 Aug 25
0
[nbdkit PATCH 1/5] api: Add .default_export
...list_exports>, and C<.default_export>, which are called outside +the lifetime of a connection. =head2 Next config, open and close @@ -355,7 +355,7 @@ from the layer below. Without error checking it would look like this: struct nbdkit_export e; char *name, *desc; - exports2 = nbdkit_exports_new (default_only); + exports2 = nbdkit_exports_new (); next_list_exports (nxdata, readonly, default_only, exports); for (i = 0; i < nbdkit_exports_count (exports2); ++i) { e = nbdkit_get_export (exports2, i); @@ -376,11 +376,9 @@ an error message and return C<-1>. Two functio...
2020 Aug 24
3
[RFC nbdkit PATCH] protocol: Alter .list_exports, add .default_export
...is possible for filters to transform the exports list received back from the layer below. Without error checking it would look like this: @@ -355,8 +361,8 @@ from the layer below. Without error checking it would look like this: struct nbdkit_export e; char *name, *desc; - exports2 = nbdkit_exports_new (default_only); - next_list_exports (nxdata, readonly, default_only, exports); + exports2 = nbdkit_exports_new (); + next_list_exports (nxdata, readonly, exports); for (i = 0; i < nbdkit_exports_count (exports2); ++i) { e = nbdkit_get_export (exports2, i); name = adjust (e....
2020 Aug 25
9
[nbdkit PATCH 0/5] Implement .default_export, nbdkit_string_intern
More patches on the way for improving .list_exports signature and adding .export_description, but this is the promised code showing why nbdkit_string_intern is useful. Patch 4 is somewhat RFC: we could either add new API to take the boilerplate from: foo_config(const char *key, const char *value) { if (strcmp (key, "file") == 0) { CLEANUP_FREE char *tmp = nbdkit_realpath (value);
2020 Aug 18
0
[PATCH nbdkit 8/9] include: Prefix all exports with NBDKIT_DLLEXPORT.
...uint32_t align, + struct nbdkit_extents *extents, + int *err); /* Export functions. */ struct nbdkit_export { @@ -132,11 +140,15 @@ struct nbdkit_export { char *description; }; -extern struct nbdkit_exports *nbdkit_exports_new (int default_only); -extern void nbdkit_exports_free (struct nbdkit_exports *); -extern size_t nbdkit_exports_count (const struct nbdkit_exports *); -extern const struct nbdkit_export nbdkit_get_export (const struct nbdkit_exports *, - size_t); +e...
2020 Aug 06
6
[nbdkit PATCH v2 0/5] .list_exports
Since v1: - patch 1: check size limits - patch 2: better handling of default export name canonicalization - patch 3: support filters as well as plugins - patch 4: new - patch 5: rewrite sh parser, fix testsuite to actually work and cover more cases (now that libnbd.git is fixed) Eric Blake (4): server: Add exports list functions server: Prepare to use export list from plugin log: Add
2020 Jul 31
6
[RFC nbdkit PATCH 0/4] Progress towards .list_exports
This takes Rich's API proposal and starts fleshing it out with enough meat that I was able to test 'nbdkit eval' advertising multiple exports with descriptions paired with 'qemu-nbd --list'. Eric Blake (3): server: Add exports list functions server: Prepare to use export list from plugin sh, eval: Add .list_exports support Richard W.M. Jones (1): server: Implement
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on .export_descriptions and a new exportname filter. I think it is now ready to check in. Things I'd still like in 1.22: - the file plugin should implement .list_exports (patch already posted, but it needs rebasing on this series) - the ext2 filter should override .list_exports when in exportname mode - the nbd plugin should be
2020 Aug 27
0
[PATCH nbdkit 1/2] docs: Remove .list_exports from release notes for 1.22.
...-165,12 +165,6 @@ New API C<nbdkit_extents_aligned> is a helper function for filters that retrieves extents as needed until at least a certain range is covered (Eric Blake). -New C<.default_export> and C<.list_exports> callbacks, and new APIs -C<nbdkit_add_export>, C<nbdkit_exports_new>, C<nbdkit_exports_free>, -C<nbdkit_exports_count>, C<nbdkit_get_export> can be used by plugins -and filters to reply to clients which want to list the exports that -the server supports (Eric Blake). - New C<nbdkit_is_tls> can be called to determine if TLS was negotiated...
2020 Sep 29
1
[nbdkit PATCH] server: Adjust limit on max NBD_OPT_* from client
...portnames (uint32_t option) +send_newstyle_option_reply_exportnames (uint32_t option, size_t *nr_options) { GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; - size_t i; + size_t i, list_len; CLEANUP_EXPORTS_FREE struct nbdkit_exports *exps = NULL; + int r; exps = nbdkit_exports_new (); if (exps == NULL) @@ -91,7 +95,8 @@ send_newstyle_option_reply_exportnames (uint32_t option) if (backend_list_exports (top, read_only, exps) == -1) return send_newstyle_option_reply (option, NBD_REP_ERR_PLATFORM); - for (i = 0; i < nbdkit_exports_count (exps); i++) { + list_len...
2020 Aug 07
0
[nbdkit RFC PATCH 4/4] exportname: New filter
...+ +#include <stdbool.h> +#include <string.h> + +#include <nbdkit-filter.h> + +#include "cleanup.h" + +static const char *default_export; +static bool list = true; +static bool strict; +struct nbdkit_exports *exports; + +static void +exportname_load (void) +{ + exports = nbdkit_exports_new (false); + if (!exports) { + nbdkit_error ("malloc: %m"); + exit (EXIT_FAILURE); + } +} + +static void +exportname_unload (void) +{ + nbdkit_exports_free (exports); +} + +/* Called for each key=value passed on the command line. */ +static int +exportname_config (nbdkit_next_confi...
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by improving libnbd to better test things, which in turn surfaced some major memory leak problems in nbdsh that are now fixed). Many of the patches are minor rebases from v2, with the biggest changes being fallout from: - patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export - overall: this missed 1.22, so update
2020 Aug 07
1
Re: [nbdkit RFC PATCH 4/4] exportname: New filter
...#include <nbdkit-filter.h> > + > +#include "cleanup.h" > + > +static const char *default_export; > +static bool list = true; > +static bool strict; > +struct nbdkit_exports *exports; > + > +static void > +exportname_load (void) > +{ > + exports = nbdkit_exports_new (false); > + if (!exports) { > + nbdkit_error ("malloc: %m"); > + exit (EXIT_FAILURE); > + } > +} > + > +static void > +exportname_unload (void) > +{ > + nbdkit_exports_free (exports); > +} > + > +/* Called for each key=value passed on the c...
2020 Aug 27
0
[nbdkit PATCH v2 2/8] api: Add nbdkit_add_default_export
...a/server/exports.c b/server/exports.c index 8d3faec4..3259fbdb 100644 --- a/server/exports.c +++ b/server/exports.c @@ -52,6 +52,7 @@ DEFINE_VECTOR_TYPE(exports, struct nbdkit_export); struct nbdkit_exports { exports exports; + bool use_default; }; struct nbdkit_exports * @@ -65,6 +66,7 @@ nbdkit_exports_new (void) return NULL; } r->exports = (exports) empty_vector; + r->use_default = false; return r; } @@ -141,3 +143,25 @@ nbdkit_add_export (struct nbdkit_exports *exps, return 0; } + +int +nbdkit_add_default_export (struct nbdkit_exports *exps) +{ + exps->use_default =...
2020 Aug 07
8
[nbdkit PATCH 0/4] More .list_exports uses
Here's changes to the file plugin (which I'm happy with) and a new exportname filter (which is still at RFC stage; I need to finish implementing strict mode in .open, and add tests). I also discovered that we really want .list_exports and .open to know when they are used on plaintext vs. tls clients for --tls=on, and we may want to split out a new .default_export callback rather than
2020 Aug 27
4
[PATCH nbdkit 0/2] Temporarily remove .list_exports for nbdkit 1.22
If you're following nbdkit development upstream you'll have seen that we are still making changes to the .list_exports and related APIs. The current .list_exports API upstream is not how it will look finally. The latest set of proposals was here: https://www.redhat.com/archives/libguestfs/2020-August/thread.html#00330 At the same time I'd like to do an nbdkit 1.22 (stable) release.
2020 Aug 27
2
Re: [nbdkit PATCH v2 2/8] api: Add nbdkit_add_default_export
...259fbdb 100644 > --- a/server/exports.c > +++ b/server/exports.c > @@ -52,6 +52,7 @@ DEFINE_VECTOR_TYPE(exports, struct nbdkit_export); > > struct nbdkit_exports { > exports exports; > + bool use_default; > }; > > struct nbdkit_exports * > @@ -65,6 +66,7 @@ nbdkit_exports_new (void) > return NULL; > } > r->exports = (exports) empty_vector; > + r->use_default = false; > return r; > } > > @@ -141,3 +143,25 @@ nbdkit_add_export (struct nbdkit_exports *exps, > > return 0; > } > + > +int > +nbdkit_add_defa...
2020 Aug 18
15
[PATCH nbdkit 0/9] Port to Windows.
Also available here: https://github.com/rwmjones/nbdkit/tree/2020-windows-mingw This is the port to Windows using native Windows APIs (not MSYS or Cygwin). This patch series is at the point where it basically now works. I can run the server with the memory plugin, and access it remotely using guestfish, creating filesystems and so on without any apparent problems. Nevertheless there are many