search for: opt_export_name

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

2019 May 19
0
[libnbd PATCH 4/4] states: Add NBD_OPT_EXPORT_NAME handling
...+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 newstyle NBD_OPT_STARTTLS option. *) @@ -565,6 +566,44 @@ and newstyle_opt_go_state_machine = [ }; ] +(* Newstyle NBD_OPT_EXPORT_NAME option. *) +and newstyle_opt_export_name_state_machine = [ + State { + default_state with +...
2019 May 19
5
[libnbd PATCH 0/4] Various interop fixes
...l 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 NBD_OPT_EXPORT_NAME handling generator/Makefile.am | 1 + generator/generator | 53 ++++++++++++++ generator/states-newstyle-opt-export-name.c | 73 +++++++++++++++++++ generator/states-newstyle-opt-go.c | 13 +++- .../states-newstyle-opt-set-meta-conte...
2019 Sep 25
0
[libnbd PATCH] lib: Synchronize nbd-protocol.h with nbdkit, again
...nbd_new_option { - uint64_t version; /* NEW_VERSION */ + uint64_t version; /* NBD_NEW_VERSION */ uint32_t option; /* NBD_OPT_* */ uint32_t optlen; /* option data length */ /* option data follows */ } NBD_ATTRIBUTE_PACKED; -/* Newstyle handshake OPT_EXPORT_NAME reply message. */ +/* Newstyle handshake OPT_EXPORT_NAME reply message. + * Modern clients use NBD_OPT_GO instead of this. + */ struct nbd_export_name_option_reply { - uint64_t exportsize; /* size of export */ - uint16_t eflags; /* per-export flags */ - char zeroes[124];...
2020 Sep 28
0
[libnbd PATCH 2/3] generator: Rename OPT_SET_META_CONTEXT states
...t;, 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 ("OPT_EXPORT_NAME", newstyle_opt_export_name_state_machine); @@ -453,8 +453,8 @@ and newstyle_opt_structured_reply_state_machine = [ }; ] -(* Fixed newstyle NBD_OPT_SET_META_CONTEXT option. *) -and newstyle_opt_set_meta_context_state_machine = [ +(* Fixed newstyle NBD_OPT_SET/LIST_META_CONTEXT option. *)...
2019 Sep 24
2
[PATCH libnbd] lib: Copy nbd-protocol.h from nbdkit 1.15.3.
...BD_NEW_VERSION UINT64_C(0x49484156454F5054) @@ -74,14 +75,14 @@ struct nbd_new_option { uint32_t option; /* NBD_OPT_* */ uint32_t optlen; /* option data length */ /* option data follows */ -} __attribute__((packed)); +} NBD_ATTRIBUTE_PACKED; /* Newstyle handshake OPT_EXPORT_NAME reply message. */ struct nbd_export_name_option_reply { uint64_t exportsize; /* size of export */ uint16_t eflags; /* per-export flags */ char zeroes[124]; /* optional zeroes */ -} __attribute__((packed));; +} NBD_ATTRIBUTE_PACKED;; /* Fixed newstyle h...
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...or any failed OPT_GO. *) Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine); Group ("OPT_LIST", newstyle_opt_list_state_machine); @@ -286,6 +288,30 @@ and newstyle_state_machine = [ Group ("OPT_GO", newstyle_opt_go_state_machine); Group ("OPT_EXPORT_NAME", newstyle_opt_export_name_state_machine); + (* When NBD_OPT_GO fails, or when opt_mode is enabled, option parsing + * can be cleanly ended without moving through the %READY state. + *) + State { + default_state with + name = "PREPARE_OPT_ABORT"; + comment = "Pre...
2019 Sep 24
0
Re: [PATCH libnbd] lib: Copy nbd-protocol.h from nbdkit 1.15.3.
...file and we > will be able to consume it from $includedir. In the mean time > synchronize with the copy in nbdkit. > --- > lib/nbd-protocol.h | 57 +++++++++++++++++++++++----------------------- > 1 file changed, 28 insertions(+), 29 deletions(-) > > /* Newstyle handshake OPT_EXPORT_NAME reply message. */ > struct nbd_export_name_option_reply { > uint64_t exportsize; /* size of export */ > uint16_t eflags; /* per-export flags */ > char zeroes[124]; /* optional zeroes */ > -} __attribute__((packed));; > +} NBD_ATTRIBUTE_P...
2019 Jun 28
0
[libnbd PATCH] opt-go: Better decoding of known errors
...----- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/generator/states-newstyle-opt-go.c b/generator/states-newstyle-opt-go.c index 91a85ef..e245c75 100644 --- a/generator/states-newstyle-opt-go.c +++ b/generator/states-newstyle-opt-go.c @@ -147,9 +147,35 @@ SET_NEXT_STATE (%^OPT_EXPORT_NAME.START); return 0; default: - if (handle_reply_error (h) == 0) - set_error (0, "handshake: unknown reply from NBD_OPT_GO: 0x%" PRIx32, - reply); + if (handle_reply_error (h) == 0) { + /* Decode expected known errors into a nicer string */ + swit...
2019 Sep 24
0
[PATCH nbdkit 4/4] common/protocol: Install <nbd-protocol.h> as a public header.
...BD_NEW_VERSION UINT64_C(0x49484156454F5054) @@ -69,14 +75,14 @@ struct nbd_new_option { uint32_t option; /* NBD_OPT_* */ uint32_t optlen; /* option data length */ /* option data follows */ -} __attribute__((packed)); +} NBD_ATTRIBUTE_PACKED; /* Newstyle handshake OPT_EXPORT_NAME reply message. */ struct nbd_export_name_option_reply { uint64_t exportsize; /* size of export */ uint16_t eflags; /* per-export flags */ char zeroes[124]; /* optional zeroes */ -} __attribute__((packed));; +} NBD_ATTRIBUTE_PACKED;; /* Fixed newstyle h...
2019 Jun 14
0
[libnbd PATCH 7/7] states: Capture NBD_REP_ERR message
...| 1 + 6 files changed, 47 insertions(+), 8 deletions(-) diff --git a/generator/states-newstyle-opt-go.c b/generator/states-newstyle-opt-go.c index 3458f09..91a85ef 100644 --- a/generator/states-newstyle-opt-go.c +++ b/generator/states-newstyle-opt-go.c @@ -147,9 +147,10 @@ SET_NEXT_STATE (%^OPT_EXPORT_NAME.START); return 0; default: + if (handle_reply_error (h) == 0) + set_error (0, "handshake: unknown reply from NBD_OPT_GO: 0x%" PRIx32, + reply); SET_NEXT_STATE (%.DEAD); - set_error (0, "handshake: unknown reply from NBD_OPT_GO: 0x%" PRIx32...
2019 Jun 29
0
[libnbd PATCH 2/6] generator: Allow DEAD state actions to run
...1; + return 0; } return 0; diff --git a/generator/states-newstyle-opt-export-name.c b/generator/states-newstyle-opt-export-name.c index 968cea8..ec73136 100644 --- a/generator/states-newstyle-opt-export-name.c +++ b/generator/states-newstyle-opt-export-name.c @@ -31,7 +31,7 @@ NEWSTYLE.OPT_EXPORT_NAME.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->wbuf = h->export_name; h->wlen = strlen (h->export_name); @@ -41,7 +41,7 @@ NEWSTYLE.OPT_EXPORT_NAME.SEND_EXPORT: switch (s...
2019 May 23
0
[PATCH libnbd 1/3] states: Factor out common code for setting export size and eflags.
...+), 20 deletions(-) diff --git a/generator/states-newstyle-opt-export-name.c b/generator/states-newstyle-opt-export-name.c index 8ff1c1c..07b6c9e 100644 --- a/generator/states-newstyle-opt-export-name.c +++ b/generator/states-newstyle-opt-export-name.c @@ -58,13 +58,13 @@ return 0; NEWSTYLE.OPT_EXPORT_NAME.CHECK_REPLY: - conn->h->exportsize = be64toh (conn->sbuf.export_name_reply.exportsize); - conn->h->eflags = be16toh (conn->sbuf.export_name_reply.eflags); - debug (conn->h, "exportsize: %" PRIu64 " eflags: 0x%" PRIx16, - conn->h->exportsize,...
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
...er the client will request structured replies, we can also expose whether the client will understand various handshake flags from the NBD protocol. Of course, we default to supporting all flags that we understand and which are advertised by the server. But clearing FIXED_NEWSTYLE lets us test NBD_OPT_EXPORT_NAME handling, and clearing NO_ZEROES lets us test whether the zero padding in response to NBD_OPT_EXPORT_NAME is correct. --- I'm still considering the addition of tests/* against nbd, or interop/* against qemu, to ensure that we have interoperability between various degraded connection modes. But...
2019 Sep 24
11
[PATCH nbdkit 0/4] common/protocol: Unify public <nbd-protocol.h>
We should have only one NBD protocol file. Let's make nbdkit's version the canonical one, and use it in libnbd. Rich.
2019 Sep 17
0
[PATCH libnbd 2/2] api: New API for reading NBD protocol.
...dex 28248ed..21aae3b 100755 --- a/generator/generator +++ b/generator/generator @@ -357,6 +357,16 @@ and newstyle_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); + + (* When option parsing has successfully finished negotiation + * it will jump to this state for final steps before moving to + * the %READY state. + *) + State { + default_state with + name = "FINISHED"; + comment = &quo...
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
2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
...e client to us). */ -struct new_option { +struct nbd_new_option { uint64_t version; /* NEW_VERSION */ uint32_t option; /* NBD_OPT_* */ uint32_t optlen; /* option data length */ /* option data follows */ } __attribute__((packed)); +/* Newstyle handshake OPT_EXPORT_NAME reply message. */ +struct nbd_export_name_option_reply { + uint64_t exportsize; /* size of export */ + uint16_t eflags; /* per-export flags */ + char zeroes[124]; /* optional zeroes */ +} __attribute__((packed));; + /* Fixed newstyle handshake reply message. */...
2019 May 23
5
[PATCH libnbd 0/3] Prevent some misuse of multi-conn.
Per recent discussion here: https://www.redhat.com/archives/libguestfs/2019-May/thread.html#00175
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples have been updated, but it demonstrates an idea: Should we forget about the concept of having multiple connections managed under a single handle? In this patch there is a single ‘struct nbd_handle *’ which manages a single state machine and connection (and therefore no nbd_connection). To connect to a multi-conn server you must
2019 Sep 17
3
[PATCH libnbd 1/2] api: Add new API to read whether TLS was negotiated.
When LIBNBD_TLS_ALLOW is used we don't have a way to find out if TLS was really negotiated. This adds a flag and a way to read it back. Unfortunately there is no test yet, because LIBNBD_TLS_ALLOW is not tested -- it really should be but requires quite a complicated set of tests because ideally we'd like to find out whether it falls back correctly for all supported servers. --- TODO