Displaying 15 results from an estimated 15 matches for "fixed_newstyle".
2020 Sep 07
0
Re: [libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
...around to
> re-supply it to the setter? In such a setup, libnbd would still be
> rejecting input of out-of-range bits in relation to what libnbd knew
> at its compilation time.
While placeholders could be used, a more natural way is to extend the
flags type (in OCaml) to:
type t =
| FIXED_NEWSTYLE
| NO_ZEROES
| UNKNOWN_FLAG of int
where the unknown (at the time of compilation) flags would be
encoded as UNKNOWN_FLAG + the bit index of the unknown flag. eg:
[ FIXED_NEWSTYLE; UNKNOWN_FLAG 2 ] => 1 | (1<<2)
(1<<3) | 2 => [ UNKNOWN_FLAG 3; NO_Z...
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
...nd just as we have exposed
whether 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 vario...
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...get NBD.TLS.DISABLE? *)
+ assert (tls = NBD.TLS.DISABLE);
let sr = NBD.get_request_structured_replies nbd in
assert (sr = true);
let flags = NBD.get_handshake_flags nbd in
- assert (flags = 3); (* XXX Add RFlags, to get NBD.HANDSHAKE_FLAG list? *)
+ assert (flags = [ NBD.HANDSHAKE_FLAG.FIXED_NEWSTYLE;
+ NBD.HANDSHAKE_FLAG.NO_ZEROES ]);
let opt = NBD.get_opt_mode nbd in
assert (opt = false)
diff --git a/ocaml/tests/test_120_set_non_defaults.ml b/ocaml/tests/test_120_set_non_defaults.ml
index 0d14710..79fe184 100644
--- a/ocaml/tests/test_120_set_non_defaults.ml
+++ b/oc...
2020 Sep 06
8
[libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
Natural fallout after my recent testsuite additions that fixed a
couple of ocaml bugs in the setters. However, on at least the OCaml
code, I'm not sure what we should do if a newer libnbd ever returns a
bit that an older NBD.mli was not expecting at the time the OCaml
compiler ran (see below). I'm also not sure if there is a more
efficient way to avoid outputting Val_FOO() converters for
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...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_ZEROES);
+ h->gflags = LIBNBD_HANDSHAKE_FLAG_MASK;
s = getenv ("LIBNBD_DEBUG");
h->debug = s && strcmp (s, "1") == 0;
diff --git a/python/t/110-defaults.py b/python/t/110-defaults.py
index 47c1d02..fb961cf 100644
-...
2019 Sep 17
1
Re: [PATCH libnbd 2/2] api: New API for reading NBD protocol.
...ones wrote:
> This commit adds a new API which can be used from the connected to
> state to read back which NBD protocol (eg. oldstyle, newstyle-fixed)
> we are using.
Somewhat of an overlap with my get_handshake_flags (as newstyle-fixed
corresponds to whether handshake_flags includes the FIXED_NEWSTYLE
flag), but I don't see the redundancy as an issue.
>
> It was helpful to add a new state in newstyle negotiation
> (%NEWSTYLE.FINISHED) so we can route all successful option
> negotiations through a single path before moving to the %READY state,
> allowing us to set h->proto...
2020 Sep 06
0
[libnbd PATCH 3/3] ocaml: Typesafe returns for REnum/RFlags
...ISABLE);
let sr = NBD.get_request_structured_replies nbd in
assert (sr = true);
let flags = NBD.get_handshake_flags nbd in
- assert (flags = 3); (* XXX Add RFlags, to get NBD.HANDSHAKE_FLAG list? *)
+ assert (flags = [ NBD.HANDSHAKE_FLAG.NO_ZEROES;
+ NBD.HANDSHAKE_FLAG.FIXED_NEWSTYLE ]);
let opt = NBD.get_opt_mode nbd in
assert (opt = false)
diff --git a/ocaml/tests/test_120_set_non_defaults.ml b/ocaml/tests/test_120_set_non_defaults.ml
index bd41e37..df3d479 100644
--- a/ocaml/tests/test_120_set_non_defaults.ml
+++ b/ocaml/tests/test_120_set_non_defaults.ml
@@ -28,14 +2...
2020 Sep 07
4
[libnbd PATCH v2 0/3] Improve type-safety of ocaml/golang getters
Well, the golang changes (patch 1 and 2/3 of v1) were already
committed, all that was left was the OCaml changes. I'm a lot happier
with how things turned out with an UNKNOWN constructor in the OCaml
variants.
Eric Blake (3):
tests: Enhance coverage of enum/flag range checking
ocaml: Support unknown values for Enum/Flags
ocaml: Typesafe returns for REnum/RFlags
generator/OCaml.ml
2020 Sep 11
0
[libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...& LIBNBD_STRICT_FLAGS) || flags > UINT16_MAX)";
flags = [
"FUA", 1 lsl 0;
"NO_HOLE", 1 lsl 1;
@@ -175,6 +177,7 @@ let cmd_flags = {
}
let handshake_flags = {
flag_prefix = "HANDSHAKE_FLAG";
+ guard = None;
flags = [
"FIXED_NEWSTYLE", 1 lsl 0;
"NO_ZEROES", 1 lsl 1;
@@ -182,12 +185,15 @@ let handshake_flags = {
}
let strict_flags = {
flag_prefix = "STRICT";
+ guard = None;
flags = [
"COMMANDS", 1 lsl 0;
+ "FLAGS", 1 lsl 1;
]
}
let allow_...
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 Sep 17
2
Re: [libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...AX)";
> flags = [
> "FUA", 1 lsl 0;
> "NO_HOLE", 1 lsl 1;
> @@ -175,6 +177,7 @@ let cmd_flags = {
> }
> let handshake_flags = {
> flag_prefix = "HANDSHAKE_FLAG";
> + guard = None;
> flags = [
> "FIXED_NEWSTYLE", 1 lsl 0;
> "NO_ZEROES", 1 lsl 1;
> @@ -182,12 +185,15 @@ let handshake_flags = {
> }
> let strict_flags = {
> flag_prefix = "STRICT";
> + guard = None;
> flags = [
> "COMMANDS", 1 lsl 0;
> + "FLAGS...
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...trict;
+
/* State machine.
*
* The actual current state is ‘state’. ‘public_state’ is updated
diff --git a/generator/API.ml b/generator/API.ml
index 962b787..8811d3c 100644
--- a/generator/API.ml
+++ b/generator/API.ml
@@ -169,7 +169,13 @@ let handshake_flags = {
flags = [
"FIXED_NEWSTYLE", 1 lsl 0;
"NO_ZEROES", 1 lsl 1;
- ]
+ ]
+}
+let strict_flags = {
+ flag_prefix = "STRICT";
+ flags = [
+ "COMMANDS", 1 lsl 0;
+ ]
}
let allow_transport_flags = {
flag_prefix = "ALLOW_TRANSPORT";
@@ -179,7 +185,8 @@ let all...
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
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...ould 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 +178,13 @@ let handshake_flags = {
flags = [
"FIXED_NEWSTYLE", 1 lsl 0;
"NO_ZEROES", 1 lsl 1;
- ]
+ ]
+}
+let strict_flags = {
+ flag_prefix = "STRICT";
+ flags = [
+ "COMMANDS", 1 lsl 0;
+ ]
}
let allow_transport_flags = {
flag_prefix = "ALLOW_TRANSPORT";
@@ -187,8 +200,8 @@ let shu...
2020 Sep 04
4
[RFC libnbd PATCH 0/2] Add knobs for client- vs. server-side validation
We have been inconsistent on how much we reject client-side without
even consulting the server, vs. how much we depend on the server to
detect failure (even if our request can be deemed undefined per NBD
protocol). I'd like to change it so that by default, we reject as
much as we can client-side for less traffic, but where the user can
also change things on the fly for server-side integration