search for: nbdkit_add_default_export

Displaying 9 results from an estimated 9 matches for "nbdkit_add_default_export".

2020 Aug 27
0
Re: [nbdkit PATCH v2 2/8] api: Add nbdkit_add_default_export
...>> helper function; this also lets us take maximum advantage of caching >> done in backend.c (since language bindings can't access our internals, >> they would have to duplicate caching if we did not add this helper >> function). > > I'm a bit confused by how nbdkit_add_default_export() should be used > and the documentation additions in this patch definitely need some > work, but I'm going to assume it's used like this: > > my_list_exports (exports) > { > nbdkit_add_export (exports, "", some_description); > /* Mark the mos...
2020 Aug 27
2
Re: [nbdkit PATCH v2 2/8] api: Add nbdkit_add_default_export
...y wrapping things in a new > helper function; this also lets us take maximum advantage of caching > done in backend.c (since language bindings can't access our internals, > they would have to duplicate caching if we did not add this helper > function). I'm a bit confused by how nbdkit_add_default_export() should be used and the documentation additions in this patch definitely need some work, but I'm going to assume it's used like this: my_list_exports (exports) { nbdkit_add_export (exports, "", some_description); /* Mark the most recently added export as the default:...
2020 Aug 27
0
[nbdkit PATCH v2 2/8] api: Add nbdkit_add_default_export
...export> to add a single export to the -list. If the plugin has a concept of a default export (usually but -not always called C<"">) then it should return that first in the list. +of exports. Call C<nbdkit_add_export> as needed to add specific +exports to the list, or C<nbdkit_add_default_export> to add a single +entry based on the results of C<.default_export>. int nbdkit_add_export (struct nbdkit_export *exports, const char *name, const char *description); + int nbdkit_add_default_export (struct nbdkit_export *exports); The C<name> must be a n...
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
...e it is not a file, setting it to largest picks the largest file in the directory for "") - the tar filter should consider an exportname mode - figure out how to let filters open the plugin without a current connection into the filter Eric Blake (8): api: Add .default_export api: Add nbdkit_add_default_export server: Respond to NBD_INFO_NAME request api: Add nbdkit_str[n]dup_intern helper sh, eval: Implement .default_export api: Alter .list_exports api: Add .export_description exportname: New filter docs/nbdkit-filter.pod | 56 ++- docs/nbdkit-plugin.pod...
2020 Aug 28
0
[nbdkit PATCH 3/3] nbd: Implement .list_exports
...nbdkit_error ("Unable to get list: %s", nbd_get_error ()); + if (nbd) { + if (nbd_aio_is_negotiating (nbd)) + nbd_opt_abort (nbd); + else if (nbd_aio_is_ready (nbd)) + nbd_shutdown (nbd, 0); + nbd_close (nbd); + } + return r; + } +#endif + return nbdkit_add_default_export (exports); +} + /* Canonical name of default export. */ static const char * nbdplug_default_export (int readonly, int is_tls) @@ -1068,6 +1120,7 @@ static struct nbdkit_plugin plugin = { .magic_config_key = "uri", .after_fork = nbdplug_after_fork, .dump_plugin...
2020 Sep 01
0
[nbdkit PATCH 1/2] python: Implement .list_exports and friends
...c int +py_list_exports (int readonly, int is_tls, struct nbdkit_exports *exports) +{ + ACQUIRE_PYTHON_GIL_FOR_CURRENT_SCOPE; + PyObject *fn; + PyObject *r; + PyObject *iter, *t; + + if (!callback_defined ("list_exports", &fn)) + /* Do the same as the core server */ + return nbdkit_add_default_export (exports); + + PyErr_Clear (); + + r = PyObject_CallFunction (fn, "ii", readonly, is_tls); + Py_DECREF (fn); + if (check_python_failure ("list_exports") == -1) + return -1; + + iter = PyObject_GetIter (r); + if (iter == NULL) { + nbdkit_error ("list_exports meth...
2020 Sep 01
4
[nbdkit PATCH 0/2] More language bindings for .list_exports
This picks up python and ocaml. Some of our languages are lacking a number of bindings (for example, lua and perl lack .extents, so I didn't have anything to copy from), and I felt less comfortable with golang and rust. But for python and ocaml, I was able to test a working implementation. Eric Blake (2): python: Implement .list_exports and friends ocaml: Implement .list_exports and
2020 Aug 28
4
[nbdkit PATCH 0/3] .list_exports in nbd plugin
Another series on top of my exportname filter, marking off another todo bullet point. With this, you can now use the NBD plugin as a transparent passthrough of all export names served by the remote server in both directions (list advertisement server to client, and export name from client to server). Eric Blake (3): nbd: Implement .default_export, .export_description nbd: Add
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
...39;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 appropriate documentation - libnbd's 'nbdinfo --list' differs in behavior between 1.4.0 and 1.4.1 regarding descriptions, so fix the tests to work for both versions - rebased on top of rewriting test-layers to use libnb...