search for: nbd_unlocked_get_list_export_name

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

2020 Jul 20
2
Re: [PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
.....2d74e5f 100644 > --- a/generator/states-newstyle-opt-starttls.c > +++ b/lib/handle.c > +int > +nbd_unlocked_set_list_exports (struct nbd_handle *h, bool list) > +{ > + h->list_exports = true; s/true/list/ (you never really tested clearing the mode...) > +char * > +nbd_unlocked_get_list_export_name (struct nbd_handle *h, > + int i) > +{ > + char *name; > + > + if (!h->list_exports) { > + set_error (EINVAL, "list exports mode not selected on this handle"); > + return NULL; > + } > + if (i < 0 || i >= (int...
2020 Jul 29
3
[libnbd PATCH 0/2] Expose export description
An incremental improvement on top of listing exports. I still think it's worth experimenting with revisiting how our API for list mode should actually work [1] (so that we can reuse a single connection for both grabbing the list and finally using NBD_OPT_GO), but this change was easier to whip together while still thinking about that. [1]
2020 Jul 20
0
Re: [PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...onnect (unless ENOTSUP). This is a bit of a mess ... > >+int > >+nbd_unlocked_set_list_exports (struct nbd_handle *h, bool list) > >+{ > >+ h->list_exports = true; > > s/true/list/ (you never really tested clearing the mode...) Oops. > >+char * > >+nbd_unlocked_get_list_export_name (struct nbd_handle *h, > >+ int i) > >+{ > >+ char *name; > >+ > >+ if (!h->list_exports) { > >+ set_error (EINVAL, "list exports mode not selected on this handle"); > >+ return NULL; > >+ } >...
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 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...bd_handle *h) +{ + return h->list_exports; +} + +int +nbd_unlocked_get_nr_list_exports (struct nbd_handle *h) +{ + if (!h->list_exports) { + set_error (EINVAL, "list exports mode not selected on this handle"); + return -1; + } + return (int) h->nr_exports; +} + +char * +nbd_unlocked_get_list_export_name (struct nbd_handle *h, + int i) +{ + char *name; + + if (!h->list_exports) { + set_error (EINVAL, "list exports mode not selected on this handle"); + return NULL; + } + if (i < 0 || i >= (int) h->nr_exports) { + set_error (EINVAL,...
2020 Aug 14
0
[libnbd PATCH v2 11/13] api: Add nbd_aio_opt_list
...get_export_description (struct nbd_handle *h) return r; } -int -nbd_unlocked_get_nr_list_exports (struct nbd_handle *h) -{ - if (!h->exports) { - set_error (EINVAL, "nbd_opt_list not yet run on this handle"); - return -1; - } - return (int) h->nr_exports; -} - -char * -nbd_unlocked_get_list_export_name (struct nbd_handle *h, - int i) -{ - char *name; - - if (!h->exports) { - set_error (EINVAL, "nbd_opt_list not yet run on this handle"); - return NULL; - } - if (i < 0 || i >= (int) h->nr_exports) { - set_error (EINVAL, "inva...
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 statement near the end of the
2020 Aug 18
0
[libnbd PATCH v3 2/2] api: Add nbd_aio_opt_list
...get_export_description (struct nbd_handle *h) return r; } -int -nbd_unlocked_get_nr_list_exports (struct nbd_handle *h) -{ - if (!h->exports) { - set_error (EINVAL, "nbd_opt_list not yet run on this handle"); - return -1; - } - return (int) h->nr_exports; -} - -char * -nbd_unlocked_get_list_export_name (struct nbd_handle *h, - int i) -{ - char *name; - - if (!h->exports) { - set_error (EINVAL, "nbd_opt_list not yet run on this handle"); - return NULL; - } - if (i < 0 || i >= (int) h->nr_exports) { - set_error (EINVAL, "inva...
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
Well, I'm not quite done (I still want to get nbdinfo to work on a single nbd connection for all cases when reading the heads of the file is not required), but I'm happy with patches 1-11, and 12-13 show where I'm headed for getting NBD_OPT_INFO to work. Posting now to see if some of the earlier patches are ready to commit while I continue working on the latter half. Eric Blake (13):