Displaying 20 results from an estimated 23 matches for "get_handshake_flag".
Did you mean:
get_handshake_flags
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...defaults.py
index 47c1d02..fb961cf 100644
--- a/python/t/110-defaults.py
+++ b/python/t/110-defaults.py
@@ -22,6 +22,5 @@ assert h.get_export_name() == ""
assert h.get_full_info() is False
assert h.get_tls() == nbd.TLS_DISABLE
assert h.get_request_structured_replies() is True
-assert h.get_handshake_flags() == (nbd.HANDSHAKE_FLAG_FIXED_NEWSTYLE |
- nbd.HANDSHAKE_FLAG_NO_ZEROES)
+assert h.get_handshake_flags() == nbd.HANDSHAKE_FLAG_MASK
assert h.get_opt_mode() is False
diff --git a/python/t/120-set-non-defaults.py b/python/t/120-set-non-defaults.py
index 3963021..3...
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 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...) =
let info = NBD.get_full_info nbd in
assert (info = false);
let tls = NBD.get_tls nbd in
- assert (tls = 0); (* XXX Add REnum, to 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_...
2020 Sep 07
1
Re: [libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
...> >This is good because Enum is passed as int.
> >
> >>[...]
> >
> >You used unsigned for RFlags, but shouldn't it be this instead?
> >
> >+ | RFlags (_) -> "uint32_t"
>
> Hmm. For Flags as input, we take uint32_t, but for
> get_handshake_flags which used to return RUint, we returned
> unsigned; as written, my patch preserved generated code in its
> entirety. Changing it to return uint32_t makes sense, but is a
> minor API change.
Oh I see, good point.
I think although technically it might not be an ABI change,
best to leave...
2020 Sep 07
2
Re: [libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
On Sat, Sep 05, 2020 at 08:40:58PM -0500, Eric Blake wrote:
> diff --git a/generator/API.mli b/generator/API.mli
> index 712e837..e45b5c0 100644
> --- a/generator/API.mli
> +++ b/generator/API.mli
> @@ -78,6 +78,8 @@ and ret =
> | RString (** return a newly allocated string,
> caller frees, NULL for error *)
> | RUInt
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
...= 2
+
+If the client is forced to use C<NBD_OPT_EXPORT_NAME> instead of
+the preferred C<NBD_OPT_GO>, this flag allows the server to send
+fewer all-zero padding bytes over the connection.
+
+=back
+
+Future NBD extensions may add further flags.
+";
+ see_also = ["L<nbd_get_handshake_flags(3)>";
+ "L<nbd_set_request_structured_replies(3)>"];
+ };
+
+ "get_handshake_flags", {
+ default_call with
+ args = []; ret = RUInt;
+ may_set_error = false;
+ shortdesc = "see which handshake flags are supported";
+ longd...
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 06
0
[libnbd PATCH 3/3] ocaml: Typesafe returns for REnum/RFlags
...) =
let info = NBD.get_full_info nbd in
assert (info = false);
let tls = NBD.get_tls nbd in
- assert (tls = 0); (* XXX Add REnum, to 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.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_...
2020 Sep 07
0
Re: [libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
...Int | REnum (_) -> "int"
>
> This is good because Enum is passed as int.
>
>> [...]
>
> You used unsigned for RFlags, but shouldn't it be this instead?
>
> + | RFlags (_) -> "uint32_t"
Hmm. For Flags as input, we take uint32_t, but for get_handshake_flags
which used to return RUint, we returned unsigned; as written, my patch
preserved generated code in its entirety. Changing it to return
uint32_t makes sense, but is a minor API change. Fortunately, it would
not be an ABI change on any of the platforms we compile on. So I can go
ahead and re...
2019 Sep 17
1
Re: [PATCH libnbd 2/2] api: New API for reading NBD protocol.
On 9/17/19 5:02 AM, Richard W.M. Jones 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 throu...
2020 Sep 06
8
[libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
...n (see below). I'm also not sure if there is a more
efficient way to avoid outputting Val_FOO() converters for types not
referenced in REnum/RFlags than my hack of __attribute__((unused)).
Hence I'll wait for a review on these.
Now, for the future compatibility lesson, promised above.
nbd_get_handshake_flags is documented as potentially returning
additional bits from a newer libnbd than what the current client code
was compiled against. How? Let's say a future NBD protocol addition
adds LIBNBD_HANDSHAKE_FLAG_64BIT (as that one might actually be a way
that we implement 64-bit requests...). Presuma...
2020 Sep 06
0
[libnbd PATCH 1/3] generator: Introduce REnum/RFlags return types
..."get_tls", {
default_call with
- args = []; ret = RInt;
+ args = []; ret = REnum (tls_enum);
may_set_error = false;
shortdesc = "get the TLS request setting";
longdesc = "\
@@ -678,7 +680,7 @@ Future NBD extensions may add further flags.
"get_handshake_flags", {
default_call with
- args = []; ret = RUInt;
+ args = []; ret = RFlags (handshake_flags);
may_set_error = false;
shortdesc = "see which handshake flags are supported";
longdesc = "\
@@ -2708,11 +2710,13 @@ let () =
failwithf "%s: if may...
2019 Oct 04
4
[PATCH libnbd 1/4] generator: Allow long ‘name - shortdesc’ in man pages.
For commands with long names and/or short descriptors, you can end up
going over 72 characters in the first line of the man page (causing
podwrapper to complain). Wrap these lines.
---
generator/generator | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/generator/generator b/generator/generator
index 7d3f656..ad1cb6b 100755
--- a/generator/generator
+++ b/generator/generator
2019 Oct 04
0
[PATCH libnbd 3/4] api: Add nbd_connect_socket.
...n L<nbd_connect_socket(3)>.
+
You can check if the connection is still connecting by calling
L<nbd_aio_is_connecting(3)>, or if it has connected to the server
and completed the NBD handshake by calling L<nbd_aio_is_ready(3)>,
@@ -2758,6 +2791,8 @@ let first_version = [
"get_handshake_flags", (1, 2);
"connect_systemd_socket_activation", (1, 2);
"aio_connect_systemd_socket_activation", (1, 2);
+ "connect_socket", (1, 2);
+ "aio_connect_socket", (1, 2);
(* These calls are proposed for a future version of libnbd, but
* have n...
2019 Sep 26
0
[PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...necting by calling
L<nbd_aio_is_connecting(3)>, or if it has connected to the server
and completed the NBD handshake by calling L<nbd_aio_is_ready(3)>,
@@ -2678,6 +2719,8 @@ let first_version = [
"get_protocol", (1, 2);
"set_handshake_flags", (1, 2);
"get_handshake_flags", (1, 2);
+ "connect_socket_activation", (1, 2);
+ "aio_connect_socket_activation", (1, 2);
(* These calls are proposed for a future version of libnbd, but
* have not been added to any released version so far.
@@ -3035,7 +3078,8 @@ end = struct
let all_external...
2020 Feb 10
0
[libnbd PATCH 1/1] generator: Add support for NBD_INFO_INIT_STATE extension
...sts. Also, since both initial state bits and block
+status are orthogonal extensions within the NBD protocol, there is no
+requirement that a server's advertisement match what could be learned
+by checking block status.
+"
+^ non_blocking_test_call_description;
+ see_also = [Link "get_handshake_flags"; Link "block_status"];
+ };
+
"get_size", {
default_call with
args = []; ret = RInt64;
@@ -2292,7 +2317,7 @@ return only one extent per metadata context where that extent
does not exceed C<count> bytes; however, libnbd does not
validate that the serv...
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 Jul 24
4
[libnbd PATCH 0/3] Expose server block size constraints
Necessary when writing a client that wants to avoid unnecessary EINVAL
errors from sending unaligned requests.
At some point, we may want to add synchronous convenience API wrappers
that do request splitting or read-modify-write to obey server
constraints while still appearing to the library client as accepting
any possible request. But such a wrapper should only be synchronous
and not copied to
2019 Sep 30
0
[PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...necting by calling
L<nbd_aio_is_connecting(3)>, or if it has connected to the server
and completed the NBD handshake by calling L<nbd_aio_is_ready(3)>,
@@ -2678,6 +2719,8 @@ let first_version = [
"get_protocol", (1, 2);
"set_handshake_flags", (1, 2);
"get_handshake_flags", (1, 2);
+ "connect_socket_activation", (1, 2);
+ "aio_connect_socket_activation", (1, 2);
(* These calls are proposed for a future version of libnbd, but
* have not been added to any released version so far.
@@ -3036,7 +3079,8 @@ end = struct
let all_external...
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...Link "set_handshake_flags"; Link "set_strict_mode";
Link "get_structured_replies_negotiated";
Link "can_meta_context"; Link "can_df"];
};
@@ -692,7 +705,7 @@ blindly setting a constant value.";
"get_handshake_flags", {
default_call with
- args = []; ret = RFlags (handshake_flags);
+ args = []; ret = RFlags handshake_flags;
may_set_error = false;
shortdesc = "see which handshake flags are supported";
longdesc = "\
@@ -706,10 +719,62 @@ protocol defines new handsha...