search for: request_sr

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

2019 Sep 04
2
[libnbd PATCH] api: Add way to avoid structured replies
...gs test. Note that nbdkit does not provide a 'can_df' callback in the sh script (so our key=value override is silently ignored), rather, we control whether nbdkit advertises df based on whether we request structured replies. --- I'm open to renaming the API to the shorter 'nbd_set_request_sr' if the existing name choice seems too long. This is a counterpart to the recent addition of --no-sr in nbdkit 1.14 for server-side disable; but by doing it in the client side, we can test lack of structured replies even while still using nbdkit 1.12.x. lib/internal.h...
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
..._internal_set_size_and_flags (h, exportsize, eflags) == -1) { SET_NEXT_STATE (%.DEAD); diff --git a/lib/handle.c b/lib/handle.c index bc4206c..8ca2e5a 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -64,6 +64,8 @@ nbd_create (void) h->unique = 1; h->tls_verify_peer = true; h->request_sr = true; + h->gflags = (LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE | + LIBNBD_HANDSHAKE_FLAG_NO_ZEROES); s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; @@ -258,6 +260,22 @@ nbd_unlocked_get_request_structured_replies (struct nbd_h...
2019 Oct 20
0
[PATCH libnbd] api: Allow NBD URIs to be restricted.
...a future version of libnbd, but * have not been added to any released version so far. diff --git a/lib/handle.c b/lib/handle.c index 1d4a527..cdbca86 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -64,6 +64,11 @@ nbd_create (void) h->unique = 1; h->tls_verify_peer = true; h->request_sr = true; + + h->uri_allow_transports = (uint32_t) -1; + h->uri_allow_tls = LIBNBD_TLS_ALLOW; + h->uri_allow_local_file = false; + h->gflags = (LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE | LIBNBD_HANDSHAKE_FLAG_NO_ZEROES); @@ -360,3 +365,24 @@ nbd_unlocked_get_protocol (...
2019 Oct 20
2
[PATCH libnbd] api: Allow NBD URIs to be restricted.
Previous discussion: https://www.redhat.com/archives/libguestfs/2019-August/msg00102.html Last night I experimentally added support for URIs that contain the query parameter tls-psk-file, as part of rewriting the tests to cover more of the URI code. So you can now have a URI like: nbds://alice@localhost/?tls-psk-file=keys.psk However there's an obvious security problem here because now
2019 Sep 17
1
[libnbd PATCH] api: Add nbd_get_structured_replies_negotiated
..., 2); "get_protocol", (1, 2); "set_handshake_flags", (1, 2); diff --git a/lib/handle.c b/lib/handle.c index 36e6434..2af25fe 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -260,6 +260,12 @@ nbd_unlocked_get_request_structured_replies (struct nbd_handle *h) return h->request_sr; } +int +nbd_unlocked_get_structured_replies_negotiated (struct nbd_handle *h) +{ + return h->structured_replies; +} + int nbd_unlocked_set_handshake_flags (struct nbd_handle *h, uint32_t flags) diff --git a/tests/meta-base-allocation.c b/tests/meta-base-a...
2020 Sep 28
0
[libnbd PATCH 2/3] generator: Rename OPT_SET_META_CONTEXT states
...y.c index 71a4952..8b689a6 100644 --- a/generator/states-newstyle-opt-structured-reply.c +++ b/generator/states-newstyle-opt-structured-reply.c @@ -22,7 +22,7 @@ STATE_MACHINE { NEWSTYLE.OPT_STRUCTURED_REPLY.START: assert (h->gflags & LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE); if (!h->request_sr) { - SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START); + SET_NEXT_STATE (%^OPT_META_CONTEXT.START); return 0; } @@ -87,7 +87,7 @@ STATE_MACHINE { if (h->opt_mode) SET_NEXT_STATE (%.NEGOTIATING); else - SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START); + SET_NEXT_STATE (...
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...pr "\n" ) all_flags; List.iter (fun (n, i) -> pr "%s = %d\n" n i) constants; diff --git a/lib/handle.c b/lib/handle.c index 7987d59..4d26842 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -65,12 +65,11 @@ nbd_create (void) h->tls_verify_peer = true; h->request_sr = true; - h->uri_allow_transports = (uint32_t) -1; + h->uri_allow_transports = LIBNBD_ALLOW_TRANSPORT_MASK; h->uri_allow_tls = LIBNBD_TLS_ALLOW; h->uri_allow_local_file = false; - h->gflags = (LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE | - LIBNBD_HANDSHAKE_FLAG_NO_...
2023 Aug 03
1
[libnbd PATCH v4 20/25] generator: Actually request extended headers
...T_EXTENDED_HEADERS. */ + +STATE_MACHINE { + NEWSTYLE.OPT_EXTENDED_HEADERS.START: + assert (h->gflags & LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE); + assert (h->opt_current != NBD_OPT_EXTENDED_HEADERS); + assert (CALLBACK_IS_NULL (h->opt_cb.completion)); + if (!h->request_eh || !h->request_sr) { + SET_NEXT_STATE (%^OPT_STRUCTURED_REPLY.START); + return 0; + } + + h->sbuf.option.version = htobe64 (NBD_NEW_VERSION); + h->sbuf.option.option = htobe32 (NBD_OPT_EXTENDED_HEADERS); + h->sbuf.option.optlen = htobe32 (0); + h->chunks_sent++; + h->wbuf = &h->sbuf...
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 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2: - now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE - four flags instead 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
2020 Oct 27
6
[PATCH libnbd 0/5] info: --map: Coalesce adjacent extents of the same type.
This adds coalescing of adjacent extents of the same type, as mentioned by Eric Blake in the commit message here: https://github.com/libguestfs/libnbd/commit/46072f6611f80245846a445766da071e457b00cd The patch series is rather long because it detours through adding the <vector.h> library from nbdkit into libnbd and replacing ad hoc uses of realloc, char ** etc in various places. Rich.
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):