search for: set_strict_mode

Displaying 12 results from an estimated 12 matches for "set_strict_mode".

2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...+102,13 @@ and link = | ExternalLink of string * int | URLLink of string +let strict_call_description = "\n +By default, libnbd will reject attempts to use this function with +parameters that are likely to result in server failure, such as +requesting an unknown command flag. The L<nbd_set_strict_mode(3)> +function can be used to alter which scenarios should await a server +reply rather than failing fast." + let non_blocking_test_call_description = "\n This call does not block, because it returns data that is saved in the handle from the NBD protocol handshake." @@ -171,7 +1...
2020 Sep 11
0
[libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...xists for future NBD -protocol extensions)."; +protocol extensions)." +^ strict_call_description; see_also = [Link "aio_pread"; Link "pread_structured"; - Link "get_block_size"]; + Link "get_block_size"; Link "set_strict_mode"]; example = Some "examples/fetch-first-sector.c"; }; @@ -1646,9 +1670,11 @@ The C<flags> parameter may be C<0> for no flags, or may contain C<LIBNBD_CMD_FLAG_DF> meaning that the server should not reply with more than one fragment (if that is supported -...
2020 Sep 17
0
Re: [libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
On 9/17/20 8:32 AM, Richard W.M. Jones wrote: > On Fri, Sep 11, 2020 at 04:49:55PM -0500, Eric Blake wrote: >> The next strict knob: allow the user to pass unknown flags across the >> wire (this is different than passing a known flag at the wrong time). >> >> It is interesting to note that NBD only permits 16 bits of flags, but >> we have a signature that takes
2020 Sep 17
2
Re: [libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...tocol extensions)."; > +protocol extensions)." > +^ strict_call_description; > see_also = [Link "aio_pread"; Link "pread_structured"; > - Link "get_block_size"]; > + Link "get_block_size"; Link "set_strict_mode"]; > example = Some "examples/fetch-first-sector.c"; > }; > > @@ -1646,9 +1670,11 @@ The C<flags> parameter may be C<0> for no flags, or may contain > C<LIBNBD_CMD_FLAG_DF> meaning that the server should not reply with > more than one fr...
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
...d of two: STRICT_FLAGS is new (patch 4), and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5) - various refactorings for more shared code and less duplication Eric Blake (5): api: Add xxx_MASK constant for each Flags type generator: Refactor filtering of accepted OFlags api: Add nbd_set_strict_mode api: Add STRICT_FLAGS to set_strict_mode api: Add STRICT_BOUNDS/ZERO_SIZE to nbd_set_strict_mode docs/libnbd.pod | 7 + lib/internal.h | 6 +- generator/API.ml | 291 ++++++++++++++---- generator/API...
2023 Jul 16
1
[libnbd PATCH] api: Fix block status assertion under set_strict bypass
...$ ./run nbdsh --opt-mode -u nbd://localhost nbd> h.set_request_meta_context(False) nbd> h.set_export_name('a') nbd> def c(arg): ... pass ... nbd> h.opt_set_meta_context_queries(['base:allocation'], c) 1 nbd> h.set_export_name('') nbd> h.opt_go() nbd> h.set_strict_mode(0) nbd> h.block_status(1024*1024, 0, c) nbdsh: generator/states-reply-chunk.c:425: enter_STATE_REPLY_CHUNK_REPLY_RECV_BS_ENTRIES: Assertion `h->meta_valid' failed. Aborted (core dumped) As this is not a typical setup, and is trivially avoided by sticking to default settings (or more safe...
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...let default_call = { args = []; optargs = []; ret = RErr; shortdesc = ""; longdesc = ""; example = None; @@ -696,6 +703,51 @@ the time of compilation."; Link "aio_is_created"; Link "aio_is_ready"]; }; + "set_strict_mode", { + default_call with + args = [ Flags ("flags", strict_flags) ]; ret = RErr; + shortdesc = "control how strictly to follow NBD protocol"; + longdesc = "\ +By default, libnbd tries to detect requests that would trigger +undefined behavior in the NBD proto...
2023 May 30
2
[libnbd PATCH v3 04/22] states: Prepare to send 64-bit requests
...any time we send an > > extended NBD_CMD_WRITE; this is such a fundamental part of the > > protocol that for now it is easier to silently ignore whatever value > > the user passes in for that bit in the flags parameter of nbd_pwrite > > regardless of the current settings in set_strict_mode, rather than > > trying to force the user to pass in the correct value to match whether > > extended mode is negotiated. However, when we later add APIs to give > > the user more control for interoperability testing, it may be worth > > adding a new set_strict_mode control...
2020 Sep 04
4
[RFC libnbd PATCH 0/2] Add knobs for client- vs. server-side validation
...block-size validation would also make sense, especially given the recent addition of support for querying server minimum block size constraints (although I'd like to finish my work on getting nbdkit to advertise block constraints to make that easier to test...). Eric Blake (2): api: Add nbd_set_strict_mode api: Add STRICT_BOUNDS to nbd_set_strict_mode lib/internal.h | 3 + generator/API.ml | 67 ++++++++++- lib/disconnect.c | 18 +-- lib/handle.c | 16 +++ lib/rw.c | 289 ++++++++++++++++++++++++++++++----------------- tests/errors.c | 61 +++++++++- 6 files changed, 340 ins...
2023 Jul 16
2
[libnbd PATCH] api: Fix block status assertion under set_strict bypass
...bd> h.set_request_meta_context(False) > nbd> h.set_export_name('a') > nbd> def c(arg): > ... pass > ... > nbd> h.opt_set_meta_context_queries(['base:allocation'], c) > 1 > nbd> h.set_export_name('') > nbd> h.opt_go() > nbd> h.set_strict_mode(0) > nbd> h.block_status(1024*1024, 0, c) > nbdsh: generator/states-reply-chunk.c:425: enter_STATE_REPLY_CHUNK_REPLY_RECV_BS_ENTRIES: Assertion `h->meta_valid' failed. > Aborted (core dumped) > > As this is not a typical setup, and is trivially avoided by sticking > to...
2020 Sep 28
0
[libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
...quot;get_nr_meta_contexts"; + Link "get_meta_context"; Link "set_opt_mode"]; }; "set_uri_allow_transports", { @@ -2814,6 +2881,9 @@ let first_version = [ (* Added in 1.5.x development cycle, will be stable and supported in 1.6. *) "set_strict_mode", (1, 6); "get_strict_mode", (1, 6); + "get_nr_meta_contexts", (1, 6); + "get_meta_context", (1, 6); + "clear_meta_contexts", (1, 6); (* These calls are proposed for a future version of libnbd, but * have not been added to any released vers...
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