search for: opt_structured_reply

Displaying 20 results from an estimated 26 matches for "opt_structured_reply".

2019 Sep 11
1
Re: [PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
...d: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.CHECK_GFLAGS -> NEWSTYLE.SEND_CFLAGS libnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.SEND_CFLAGS -> NEWSTYLE.OPT_STARTTLS.START nbdkit: libnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.OPT_STARTTLS.START -> NEWSTYLE.OPT_STRUCTURED_REPLY.START fulllibnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.OPT_STRUCTURED_REPLY.START -> NEWSTYLE.OPT_STRUCTURED_REPLY.SEND [1]: libnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.OPT_STRUCTURED_REPLY.SEND -> NEWSTYLE.OPT_STRUCTURED_REPLY.RECV_REPLY debug: newstyle negotiati...
2019 Sep 11
4
[PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
Very much a work in progress as there are still many tests using qemu-io which are candidates for conversion. You'll notice at the end of test-full.sh that the new test has some duplicated code which looks as if it ought to be refactored into a Python function. When I tried to do that, I got loads of strange Python problems which may indicate bugs in nbdsh itself or problems with my
2023 Aug 03
1
[libnbd PATCH v4 20/25] generator: Actually request extended headers
This is the culmination of the previous patches' preparation work for using extended headers when possible. The new states in the state machine are copied extensively from our handling of OPT_STRUCTURED_REPLY. The next patch will then expose a new API nbd_opt_extended_headers() for manual control. At the same time I posted this patch, I had patches for qemu-nbd to support extended headers as server (nbdkit is a bit tougher). The next patches will add some interop tests that pass when using a new enou...
2020 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...te_machine.ml @@ -273,6 +273,7 @@ and newstyle_state_machine = [ * state needs to run and skip to the next state in the list if not. *) Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine); + Group ("OPT_LIST", newstyle_opt_list_state_machine); Group ("OPT_STRUCTURED_REPLY", 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...
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
2
Re: [PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...7 @@ and newstyle_state_machine = [ > * state needs to run and skip to the next state in the list if not. > *) > Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine); > + Group ("OPT_LIST", newstyle_opt_list_state_machine); > Group ("OPT_STRUCTURED_REPLY", 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 = [ > };...
2019 Jun 14
0
[libnbd PATCH 5/7] states: Factor out NBD_REP payload prep
...AD"; - comment = "Skip newstyle NBD_OPT_STARTTLS reply payload"; + name = "RECV_REPLY_PAYLOAD"; + comment = "Receive any newstyle NBD_OPT_STARTTLS reply payload"; external_events = [ NotifyRead, "" ]; }; @@ -425,8 +425,8 @@ and newstyle_opt_structured_reply_state_machine = [ State { default_state with - name = "SKIP_REPLY_PAYLOAD"; - comment = "Skip newstyle NBD_OPT_STRUCTURED_REPLY reply payload"; + name = "RECV_REPLY_PAYLOAD"; + comment = "Receive any newstyle NBD_OPT_STRUCTURED_REPLY reply pay...
2020 Jul 20
0
Re: [PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...), and there's scope for more fields in future. With the current API we can add more fields in future. > >+++ b/generator/states-newstyle-opt-list.c > > >+STATE_MACHINE { > >+ 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 = siz...
2020 Aug 11
3
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...ed straight to Dead on any error reply to an NBD_OPT request, the new mode can jump back to Negotiating to give the client a chance to try something else, moving back into Connecting once a command is started. > > 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 need to write a states -> dot graph visualizer!) When we've > got to the negotiating state we can then get the list of exports, set > the export name we want,...
2020 Sep 28
0
[libnbd PATCH 2/3] generator: Rename OPT_SET_META_CONTEXT states
...generator/state_machine.ml b/generator/state_machine.ml index c1fb073..10b6983 100644 --- a/generator/state_machine.ml +++ b/generator/state_machine.ml @@ -283,7 +283,7 @@ and newstyle_state_machine = [ *) Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine); Group ("OPT_STRUCTURED_REPLY", newstyle_opt_structured_reply_state_machine); - Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine); + Group ("OPT_META_CONTEXT", newstyle_opt_meta_context_state_machine); Group ("OPT_GO", newstyle_opt_go_state_machine); Group (&q...
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...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 >> remainder of opt negotiation can be controlled by the caller.  (I >> really need to write a states -> dot graph visualizer!)  When we've >> got to the negotiating state we can then get the list of exports, set >> the expor...
2019 Sep 16
1
[libnbd PATCH] states: Avoid magic number for h->tls
...e-opt-starttls.c +++ b/generator/states-newstyle-opt-starttls.c @@ -21,7 +21,7 @@ /* STATE MACHINE */ { NEWSTYLE.OPT_STARTTLS.START: /* If TLS was not requested we skip this option and go to the next one. */ - if (!h->tls) { + if (h->tls == LIBNBD_TLS_DISABLE) { SET_NEXT_STATE (%^OPT_STRUCTURED_REPLY.START); return 0; } @@ -88,13 +88,13 @@ return 0; } - /* Server refused to upgrade to TLS. If h->tls is not require (2) + /* Server refused to upgrade to TLS. If h->tls is not 'require' (2) * then we can continue unencrypted. */ - if (h->...
2019 Jun 14
10
[libnbd PATCH 0/7] state machine refactoring
I'm still playing with ideas on how to split rstate from wstate (so that we can send a request without waiting for POLLIN to complete a pending reply), but this is some preliminary refactoring I found useful. I also fixed a couple of bugs while in the area (already pushed). There's a question of whether we want nbd_handle to be nearly 5k, or if we should instead keep it small and add one
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...Options. These state groups are always entered unconditionally, * in this order. The START state in each group will check if the * state needs to run and skip to the next state in the list if not. + * When opt_mode is set, control is returned to the user in state + * NEGOTIATING after OPT_STRUCTURED_REPLY or any failed OPT_GO. *) Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine); Group ("OPT_LIST", newstyle_opt_list_state_machine); @@ -279,6 +288,23 @@ and newstyle_state_machine = [ Group ("OPT_GO", newstyle_opt_go_state_machine); Group ("...
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
2019 May 19
5
[libnbd PATCH 0/4] Various interop fixes
Some of these affect attempts to connect to older qemu-nbd versions, some of them were triggered by manual edits to qemu-nbd source code to provoke various other compliant (if uncommon) server behaviors. Eric Blake (4): starttls: Skip error payload if falling back to unencrypted states: Reject payload to NBD_REP_ACK meta-context: Skip error payload if server lacks meta_context states: Add
2019 Jun 14
0
[libnbd PATCH 7/7] states: Capture NBD_REP_ERR message
...@@ debug (h, "server refused TLS (%s), continuing with unencrypted connection", reply == NBD_REP_ERR_POLICY ? "policy" : "not supported"); - /* XXX: capture instead of skip server's payload to NBD_REP_ERR*? */ SET_NEXT_STATE (%^OPT_STRUCTURED_REPLY.START); return 0; } diff --git a/generator/states-newstyle-opt-structured-reply.c b/generator/states-newstyle-opt-structured-reply.c index d755411..65d5958 100644 --- a/generator/states-newstyle-opt-structured-reply.c +++ b/generator/states-newstyle-opt-structured-reply.c @@ -67,7 +67,11 @@...
2019 Jun 29
0
[libnbd PATCH 2/6] generator: Allow DEAD state actions to run
...ed handshake. */ diff --git a/generator/states-newstyle-opt-structured-reply.c b/generator/states-newstyle-opt-structured-reply.c index 65d5958..d932248 100644 --- a/generator/states-newstyle-opt-structured-reply.c +++ b/generator/states-newstyle-opt-structured-reply.c @@ -30,7 +30,7 @@ NEWSTYLE.OPT_STRUCTURED_REPLY.SEND: switch (send_from_wbuf (h)) { - case -1: SET_NEXT_STATE (%.DEAD); return -1; + case -1: SET_NEXT_STATE (%.DEAD); return 0; case 0: h->rbuf = &h->sbuf; h->rlen = sizeof h->sbuf.or.option_reply; @@ -40,11 +40,11 @@ NEWSTYLE.OPT_STRUCTURED_REPLY.RECV_REPLY:...
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...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 need to write a states -> dot graph visualizer!) When we've got to the negotiating state we can then get the list of exports, set the export name we want, and then finish the...
2019 May 19
0
[libnbd PATCH 4/4] states: Add NBD_OPT_EXPORT_NAME handling
...wstyle-opt-go.c \ states-newstyle-opt-set-meta-context.c \ states-newstyle-opt-starttls.c \ diff --git a/generator/generator b/generator/generator index 4d42185..60e4c55 100755 --- a/generator/generator +++ b/generator/generator @@ -327,6 +327,7 @@ and newstyle_state_machine = [ Group ("OPT_STRUCTURED_REPLY", 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); + Group ("OPT_EXPORT_NAME", newstyle_opt_export_name_state_machine); ] (* Fixed...