search for: set_opt_mode

Displaying 20 results from an estimated 38 matches for "set_opt_mode".

2020 Aug 14
0
[libnbd PATCH v2 12/13] wip: api: Give aio_opt_go a completion callback
...ot;10809") # Connect to a remote server. h.get_size () # Get size of the remote disk. buf = h.pread (512, 0, 0) # Read the first sector. exit() or Ctrl-D # Quit the shell help (nbd) # Display documentation nbd> h.set_opt_mode(True) nbd> h.connect_command(["nbdkit","-s","--exit-","eval", "open=echo ENOENT >&2; exit 1"]) nbd> h.aio_is_negotiating() True nbd> h.set_export_name('a') nbd> h.opt_go() nbdkit: eval: error: /tmp/nbdkitNyQD8J/open: ENOEN...
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
...he earlier patches are ready to commit while I continue working on the latter half. Eric Blake (13): api: Add nbd_set_full_info and friends info: Improve info without --list api: Add nbd_is_state_negotiating 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: ad...
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
This is the bare minimum needed to allow the user to take control over the rest of option negotiating. This patch adds several new API: nbd_set_opt_mode() - called during Created to enable the new mode nbd_get_opt_mode() - query whether opt mode is enabled nbd_opt_go() - used in Negotiating state to attempt to use export nbd_opt_abort() - used in Negotiating state to skip Connected state nbd_aio_is_negotiating() - used to detect Negotiating state...
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...quot;]; + see_also = [Link "get_opt_mode"; Link "aio_is_negotiating"; + Link "opt_abort"]; }; "get_opt_mode", { @@ -715,6 +716,19 @@ Return true if option negotiation mode was enabled on this handle."; see_also = [Link "set_opt_mode"]; }; + "opt_abort", { + default_call with + args = []; ret = RErr; + permitted_states = [ Negotiating ]; + shortdesc = "end negotiation and close the connection"; + longdesc = "\ +Request that the server finish negotiation, gracefully if possible,...
2020 Sep 28
2
[libnbd PATCH] nbdsh: Add --opt-mode command line option
...multiple times in order to run multiple commands. +=item B<--opt-mode> + +Request that option mode be enabled, which gives fine-grained control +over option negotiation after initially contacting the server but +prior to actually using the export. This is equivalent to calling +S<C<h.set_opt_mode(True)>> in the shell prior to connecting, and works +even when combined with C<--uri> (while attempting the same with C<-c> +would be too late). + =item B<-c -> =item B<--command -> @@ -85,6 +96,12 @@ Read standard input and execute it as a command. Connect to the...
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 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...st the server to list available meta contexts"; + longdesc = "\ +Request that the server list available meta contexts associated with +the export previously specified by the most recent +L<nbd_set_export_name(3)> or L<nbd_connect_uri(3)>. This can only be +used if L<nbd_set_opt_mode(3)> enabled option mode. + +The NBD protocol allows a client to decide how many queries to ask +the server. Rather than taking that list of queries as a parameter +to this function, libnbd reuses the current list of requested meta +contexts as set by L<nbd_add_meta_context(3)>; you can us...
2020 Aug 19
3
[libnbd PATCH 0/2] NBD_OPT_INFO support
This replaces 13/13 of my v2 series; and now that it has pretty good testsuite coverage and demonstrable performance improvement to nbdinfo, I'm going ahead and pushing this now. We may still want to add further nbd_opt_* commands for other fine-grained tuning of negotiation, but for now, I think things have stabilized on this end, and I can return to polishing .list_exports on the nbdkit
2020 Aug 14
0
[libnbd PATCH v2 11/13] api: Add nbd_aio_opt_list
...+ args = [ Closure list_closure ]; ret = RInt; permitted_states = [ Negotiating ]; shortdesc = "request the server to list all exports during negotiation"; longdesc = "\ Request that the server list all exports that it supports. This can only be used if L<nbd_set_opt_mode(3)> enabled option mode. -In this mode, during connection we query the server for the list -of NBD exports and collect them in the handle. You can query -the list of exports provided by the server by calling -L<nbd_get_nr_list_exports(3)> and L<nbd_get_list_export_name(3)>. -After...
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
I'm posting this now, as I'm at the end of a workday and I got things working for manual experimentation. Still to do: - write interop tests for qemu-nbd and nbdkit (including my proposed patch addition of qemu-nbd -A to show qemu:allocation-depth) - figure out if we can make 'nbdinfo --map' use the new API to automatically select all contexts advertised by the server Eric Blake
2020 Sep 21
0
[nbdkit PATCH v3 03/14] server: Respond to NBD_INFO_NAME request
...t;'EOF' +case "$1" in + default_export) echo hello ;; + open) echo "$3" ;; + export_description) echo "$2 world" ;; + get_size) echo 0 ;; + *) exit 2 ;; +esac +EOF + +# Without client request, nothing is advertised +nbdsh -c ' +import os + +h.set_opt_mode(True) +h.connect_unix(os.environ["sock"]) + +h.set_export_name("a") +h.opt_info() +try: + h.get_canonical_export_name() + assert False +except nbd.Error as ex: + pass + +h.set_export_name("") +h.opt_info() +try: + h.get_canonical_export_name() + assert False +exce...
2020 Aug 18
0
[libnbd PATCH v3 2/2] api: Add nbd_aio_opt_list
...+ args = [ Closure list_closure ]; ret = RInt; permitted_states = [ Negotiating ]; shortdesc = "request the server to list all exports during negotiation"; longdesc = "\ Request that the server list all exports that it supports. This can only be used if L<nbd_set_opt_mode(3)> enabled option mode. -In this mode, during connection we query the server for the list -of NBD exports and collect them in the handle. You can query -the list of exports provided by the server by calling -L<nbd_get_nr_list_exports(3)> and L<nbd_get_list_export_name(3)>. -After...
2023 Mar 23
1
[libnbd PATCH v3 18/19] generator: Add APIs to get/set the socket activation socket name
..._socket_activation_name(3)> before calling +the connect function. " ^ blocking_connect_call_description; see_also = [Link "aio_connect_systemd_socket_activation"; Link "connect_command"; Link "kill_subprocess"; Link "set_opt_mode"; + Link "set_socket_activation_name"; + Link "get_socket_activation_name"; ExternalLink ("qemu-nbd", 1); URLLink "http://0pointer.de/blog/projects/socket-activation.html"]; example = S...
2020 Oct 02
4
[libnbd PATCH v2 0/2] opt_list_meta_context
In v2: ack'ed preliminary patches have been pushed, and I've added a lot of testsuite coverage as well as putting the new API to use in nbdinfo. Eric Blake (2): api: Add nbd_opt_list_meta_context info: List available meta-contexts lib/internal.h | 1 + generator/API.ml | 84 ++++++++-
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
I think this needs extra documentation in docs/libnbd.pod because it's definitely not clear just from the rather thin manual page for set_opt_mode how it works. docs/libnbd.pod is a good place for a broader description of how it works. IIUC let me try to explain: we get through as far as the end of group OPT_STRUCTURED_REPLY before we check the opt flag, and then the remainder of opt negotiation can be controlled by the caller. (I really n...
2020 Aug 11
3
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
On 8/11/20 12:12 PM, Richard W.M. Jones wrote: > I think this needs extra documentation in docs/libnbd.pod because it's > definitely not clear just from the rather thin manual page for > set_opt_mode how it works. docs/libnbd.pod is a good place for a > broader description of how it works. Yes, good idea. State-wise, the existing flow was: Created - Progress only by command issue - namely one of nbd_connect_* Connecting - Progress by aio_notify_read/aio_notify_write (as driven by a...
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
On 8/11/20 12:38 PM, Eric Blake wrote: > On 8/11/20 12:12 PM, Richard W.M. Jones wrote: >> I think this needs extra documentation in docs/libnbd.pod because it's >> definitely not clear just from the rather thin manual page for >> set_opt_mode how it works.  docs/libnbd.pod is a good place for a >> broader description of how it works. > > Yes, good idea. > >> >> IIUC let me try to explain: we get through as far as the end of group >> OPT_STRUCTURED_REPLY before we check the opt flag, and then the >&...
2020 Sep 06
0
[libnbd PATCH 3/3] ocaml: Typesafe returns for REnum/RFlags
...LS.ALLOW); ); NBD.set_request_structured_replies nbd false; let sr = NBD.get_request_structured_replies nbd in assert (sr = false); NBD.set_handshake_flags nbd []; let flags = NBD.get_handshake_flags nbd in - assert (flags = 0); (* XXX Add RFlags *) + assert (flags = []); NBD.set_opt_mode nbd true; let opt = NBD.get_opt_mode nbd in assert (opt = true) -- 2.28.0
2022 Nov 04
3
[libnbd PATCH v2 0/3] Improve nbdsh -u handling
v1 was here: https://listman.redhat.com/archives/libguestfs/2022-October/030216.html Since then, I've incorporated changes based on Rich's feedback: swap order of patches 2 and 3 less change in patch 1 (including no unsafe eval(%s) for --uri) in patch 2, include -c in list of snippets to store, and use dict of lambdas to map back to the desired action Eric Blake (3): nbdsh:
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...o get NBD.HANDSHAKE_FLAG list? *) + assert (flags = [ NBD.HANDSHAKE_FLAG.FIXED_NEWSTYLE; + NBD.HANDSHAKE_FLAG.NO_ZEROES ]); NBD.set_handshake_flags nbd []; let flags = NBD.get_handshake_flags nbd in - assert (flags = 0); (* XXX Add RFlags *) + assert (flags = []); NBD.set_opt_mode nbd true; let opt = NBD.get_opt_mode nbd in assert (opt = true) -- 2.28.0