search for: nbd_opt_list

Displaying 20 results from an estimated 88 matches for "nbd_opt_list".

2020 Aug 18
3
[libnbd PATCH v3 0/2] Implementing NBD_OPT_LIST
This is a subset of my v2 posting, but limited to just the NBD_OPT_LIST handling. The biggest change since v2 is the addition of added unit testing in all four language bindings (C, python, ocaml, golang). The tests require nbdkit built from git on PATH, and may not be entirely idiomatic, but I at least validated that they catch issues (for example, adding an exit sta...
2020 Aug 18
0
[libnbd PATCH v3 2/2] api: Add nbd_aio_opt_list
This continues the changes for adding NBD_OPT_LIST support. Now, instead of libnbd malloc'ing storage itself, the user passes a callback that can handle name/description pairs however it likes, and we get rid of the artificial cap at 10000 exports. However, the user will probably end up malloc'ing a list themselves, as we can't call n...
2020 Aug 14
0
[libnbd PATCH v2 11/13] api: Add nbd_aio_opt_list
This continues the changes for adding NBD_OPT_LIST support. Now, instead of libnbd malloc'ing storage itself, the user passes a callback that can handle name/description pairs however it likes, and we get rid of the artificial cap at 10000 exports. However, the user will probably end up malloc'ing a list themselves, as we can't call n...
2020 Jul 20
2
Re: [PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...te_machine); > Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine); > Group ("OPT_GO", newstyle_opt_go_state_machine); > @@ -341,6 +342,44 @@ and newstyle_opt_starttls_state_machine = [ > }; > ] > > +(* Fixed newstyle NBD_OPT_LIST option. *) > +and newstyle_opt_list_state_machine = [ > + State { > + default_state with > + name = "START"; > + comment = "Start listing exports if in list mode."; > + external_events = []; > + }; > + > + State { > + default_state...
2020 Sep 29
1
[nbdkit PATCH] server: Adjust limit on max NBD_OPT_* from client
...ing an export or quitting, and we were justified in dropping indecisive chatty clients as being a waste of server resources. But now that we support .list_exports, it is reasonable for a client (such as 'qemu-nbd --list' or 'nbdinfo --list') to want to call NBD_OPT_INFO and several NBD_OPT_LIST_META_CONTEXT commands for every export returned in NBD_OPT_LIST. We still want to avoid clients that can tie us up in eternal handshaking, so let's reject a second call to NBD_OPT_LIST; but once the first call is made, the client now has a chance to get info on everything listed. Signed-off-b...
2020 Jul 21
3
Extending nbdkit to support listing exports
...trary limits (what escape character to use? what is the max length?) Also changing the NBD protocol is not under consideration. I think we need to consider these aspects separately: (a) How filters and plugins get the client exportname. (b) How filters and plugins respond when the client issues NBD_OPT_LIST. (c) How the server, filters and plugins respond to NBD_OPT_INFO. (a) Client exportname --------------------- The client sends the export name of the export it wants to access with NBD_OPT_EXPORT_NAME or the newer NBD_OPT_GO. This is an opaque string (not a filename, pathname etc). Currently...
2020 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...quot;, newstyle_opt_structured_reply_state_machine); Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine); Group ("OPT_GO", newstyle_opt_go_state_machine); @@ -341,6 +342,44 @@ and newstyle_opt_starttls_state_machine = [ }; ] +(* Fixed newstyle NBD_OPT_LIST option. *) +and newstyle_opt_list_state_machine = [ + State { + default_state with + name = "START"; + comment = "Start listing exports if in list mode."; + external_events = []; + }; + + State { + default_state with + name = "SEND"; + comment =...
2020 Jul 20
2
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
Proposal for new APIs to list exports. The general shape of the API can probably best be seen from the examples/list-exports.c example. Rich.
2020 Aug 07
1
Re: [nbdkit PATCH 2/4] file: Add .list_exports support
On Thu, Aug 06, 2020 at 09:23:46PM -0500, Eric Blake wrote: > + if (!filename == !directory) { A bit tricksy. In plugins/nbd/nbd.c I used: int c = !!sockname + !!hostname + !!uri + (command.size > 0) + (socket_fd >= 0) + !!raw_cid; /* Check the user passed exactly one connection parameter. */ if (c > 1) { nbdkit_error ("cannot mix Unix ‘socket’, TCP
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
...tiating for new state api: Permit several existing API in Negotiating state api: Add nbd_set_opt_mode api: Add nbd_opt_abort and nbd_aio_opt_abort api: Add nbd_opt_go and nbd_aio_opt_go examples: Update list-exports to demonstrate nbd_opt_go info: Simplify by using nbd_opt_go api: Add nbd_opt_list api: Add nbd_aio_opt_list wip: api: Give aio_opt_go a completion callback wip: api: add nbd_opt_info, nbd_aio_opt_info docs/libnbd.pod | 42 +- lib/internal.h | 45 +- lib/nbd-protocol.h | 10 +- gene...
2020 Jul 22
3
[PATCH nbdkit v2] PROPOSED: server: Implement list_exports.
Updated proposal, taking into account the default export. Instead of adding a second call, I made a couple of changes to list_exports: (1) If the plugin has a concept of a default export, it should add it as the first element in the exports list. (2) There is a new default_only flag which tells the plugin that the client is trying to request the name of the default export, so the
2020 Jul 21
0
Re: Extending nbdkit to support listing exports
...onsidered because they are too risky, and run into arbitrary > limits (what escape character to use? what is the max length?) Also > changing the NBD protocol is not under consideration. Not directly, but maybe it is worth adding optional support to the NBD protocol to make it possible for NBD_OPT_LIST to support a hierarchical return. That is, pointing the file plugin to serve directory=base containing the following layout: base + f1 + dir1 + f2 + f3 + dir2 + f4 the current semantics of NBD_OPT_LIST only lend themselves to returning 4 NBD_REP_SERVER replies in a row: &quot...
2020 Jul 22
0
[PATCH nbdkit] PROPOSED: server: Implement list_exports.
...e connection, call C<nbdkit_error> with an error message and return C<-1>. +=head2 C<.list_exports> + + int list_exports (int readonly, struct nbdkit_exports *exports); + +This optional callback is called if the client tries to list the +exports served by the plugin (using C<NBD_OPT_LIST>). If the plugin +does not supply this callback then a single export called C<""> is +returned. The NBD protocol defines C<""> as the default export, so +this is suitable for plugins which ignore the export name and always +serve the same content. See also L&lt...
2020 Sep 07
0
[libnbd PATCH 2/2] generator: Free closures on failure
...,9 @@ nbd_unlocked_aio_opt_list (struct nbd_handle *h, nbd_list_callback *list, assert (CALLBACK_IS_NULL (h->opt_cb.fn.list)); h->opt_cb.fn.list = *list; + SET_CALLBACK_TO_NULL (*list); h->opt_cb.completion = *complete; + SET_CALLBACK_TO_NULL (*complete); h->opt_current = NBD_OPT_LIST; if (nbd_internal_run (h, cmd_issue) == -1) debug (h, "option queued, ignoring state machine failure"); diff --git a/lib/rw.c b/lib/rw.c index 9f2909b..4b8eeaf 100644 --- a/lib/rw.c +++ b/lib/rw.c @@ -72,6 +72,7 @@ nbd_unlocked_pread_structured (struct nbd_handle *h, void *buf,...
2020 Sep 07
4
[libnbd PATCH 0/2] Fix memory leak with closures
As promised in my earlier thread on libnbd completion callback question. Eric Blake (2): generator: Refactor handling of closures in unlocked functions generator: Free closures on failure docs/libnbd.pod | 2 +- generator/C.ml | 48 +++++++++++------ generator/C.mli | 1 + lib/debug.c | 7 +-- lib/opt.c | 31 ++++++-----
2020 Jul 22
0
[PATCH nbdkit v2] PROPOSED: server: Implement list_exports.
...t; with an error message and return C<-1>. +=head2 C<.list_exports> + + int list_exports (int readonly, int default_only, + struct nbdkit_exports *exports); + +This optional callback is called if the client tries to list the +exports served by the plugin (using C<NBD_OPT_LIST>). If the plugin +does not supply this callback then a single export called C<""> is +returned. The NBD protocol defines C<""> as the default export, so +this is suitable for plugins which ignore the export name and always +serve the same content. See also L&lt...
2018 Aug 06
3
Re: [PATCH nbdkit] protocol: Implement NBD_OPT_GO.
On 08/06/2018 09:31 AM, Nir Soffer wrote: > Eric, can you point us to the part of the spec allowing ignoring the export > name sent by the client? Nothing in the NBD spec requires the server to reject unknown export names. So nbdkit never rejects export names (which means it behaves as if all names work, regardless of whether or not it was the name it was configured with, since it
2020 Jul 20
0
Re: [PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...> >+ NEWSTYLE.OPT_LIST.START: > >+ if (!h->list_exports) { > >+ SET_NEXT_STATE (%^OPT_STRUCTURED_REPLY.START); > >+ return 0; > >+ } > >+ > >+ h->sbuf.option.version = htobe64 (NBD_NEW_VERSION); > >+ h->sbuf.option.option = htobe32 (NBD_OPT_LIST); > >+ h->sbuf.option.optlen = 0; > >+ h->wbuf = &h->sbuf; > >+ h->wlen = sizeof (h->sbuf.option); > >+ SET_NEXT_STATE (%SEND); > >+ return 0; > > Is it worth enhancing the code to add another list mode where we can > also query NBD_OP...
2018 Nov 29
2
[nbdkit PATCH] connections: Implement NBD_OPT_INFO
qemu is about to add 'qemu-nbd --list', which exercises NBD_OPT_LIST and NBD_OPT_INFO to give the user as much detail as possible about an export without actually connecting to it. For that to display more than the export name when nbdkit is the server, we need to implement NBD_OPT_INFO. Thankfully, the NBD spec intentionally made the command very similar to NBD_O...
2020 Jul 31
0
[nbdkit PATCH 3/4] server: Implement list_exports.
...gt; with an error message and return C<-1>. +=head2 C<.list_exports> + + int list_exports (int readonly, int default_only, + struct nbdkit_exports *exports); + +This optional callback is called if the client tries to list the +exports served by the plugin (using C<NBD_OPT_LIST>). If the plugin +does not supply this callback then a single export called C<""> is +returned. The NBD protocol defines C<""> as the default export, so +this is suitable for plugins which ignore the export name and always +serve the same content. See also L&lt...