Displaying 20 results from an estimated 28 matches for "all_flags".
2019 Aug 10
0
[PATCH libnbd 8/9] generator: Enhance Flags/OFlags with optional "all flags" mask.
...1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/generator/generator b/generator/generator
index a6aea26..fe24738 100755
--- a/generator/generator
+++ b/generator/generator
@@ -898,6 +898,7 @@ and enum = {
}
and flags = {
flag_prefix : string; (* prefix of each flag name *)
+ all_flags_bitmask : bool; (* if true, generate a bitmask of all flags *)
flags : (string * int) list (* flag names and their values in C *)
}
and permitted_state =
@@ -930,6 +931,7 @@ let all_enums = [ tls_enum ]
(* Flags. *)
let cmd_flags = {
flag_prefix = "CMD_FLAG";
+ all_flags_bitmas...
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...pr "#define %-40s %d\n" flag i
+ pr "#define %-40s 0x%02x\n" flag i;
+ mask := !mask lor i
) flags;
+ let flag = sprintf "LIBNBD_%s_MASK" flag_prefix in
+ pr "#define %-40s 0x%02x\n" flag !mask;
pr "\n"
) all_flags;
List.iter (
@@ -490,13 +494,12 @@ let generate_lib_api_c () =
);
(* Check parameters are valid. *)
- let print_flags_check n { flag_prefix; flags } =
+ let print_flags_check n { flag_prefix } =
let value = match errcode with
| Some value -> value
| N...
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...saved in
the handle from the NBD protocol handshake."
+(* Flags. *)
+let cmd_flags = {
+ flag_prefix = "CMD_FLAG";
+ flags = [
+ "FUA", 1 lsl 0;
+ "NO_HOLE", 1 lsl 1;
+ "DF", 1 lsl 2;
+ "REQ_ONE", 1 lsl 3;
+ ]
+}
+let all_flags = [ cmd_flags ]
+
(* Calls.
*
* The first parameter [struct nbd_handle *nbd] is implicit.
@@ -1387,7 +1403,7 @@ Returns the size in bytes of the NBD export."
"pread", {
default_call with
args = [ BytesOut ("buf", "count"); UInt64 "offset&quo...
2019 Aug 10
2
Re: [PATCH libnbd 9/9] FOR DISCUSSION ONLY: api: Add ‘allow’ parameter to nbd_connect_uri to control permitted URIs.
...he docs and example code
implies the use of the REQUIRE_TLS flag. Is that intentional that
passing all flags forbids the use of non-encrypted connections?
> +++ b/generator/generator
> @@ -939,7 +939,17 @@ let cmd_flags = {
> "REQ_ONE", 1 lsl 3;
> ]
> }
> -let all_flags = [ cmd_flags ]
> +let connect_uri_allow_flags = {
> + flag_prefix = "CONNECT_URI";
> + all_flags_bitmask = true;
> + flags = [
> + "ALLOW_TCP", 1 lsl 0;
> + "ALLOW_UNIX", 1 lsl 1;
> + "ALLOW_TLS", 1 lsl 2;
> + &quo...
2019 Aug 10
17
[PATCH libnbd 0/9] Add Enum and Flags types.
This largish series adds several new features to the generator.
Enum maps to enumerated types (like enum in C). The only current use
for this is replacing the nbd_set_tls (nbd, 0/1/2) parameter with
LIBNBD_TLS_DISABLE, LIBNBD_TLS_ALLOW, LIBNBD_TLS_REQUIRE (and natural
equivalents in other programming languages).
Flags maps to any uint32_t bitmask. It is basically a non-optional,
generalized
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
...ONE (1<<3)
+*/
/* NBD error codes. */
#define NBD_SUCCESS 0
diff --git a/generator/generator b/generator/generator
index a72f36c..170121e 100755
--- a/generator/generator
+++ b/generator/generator
@@ -971,7 +971,14 @@ let cmd_flags = {
"FAST_ZERO", 1 lsl 4;
]
}
-let all_flags = [ cmd_flags ]
+let handshake_flags = {
+ flag_prefix = "HANDSHAKE_FLAG";
+ flags = [
+ "FIXED_NEWSTYLE", 1 lsl 0;
+ "NO_ZEROES", 1 lsl 1;
+ ]
+}
+let all_flags = [ cmd_flags; handshake_flags ]
(* Calls.
*
@@ -1261,6 +1268,7 @@ for integration test...
2018 Dec 14
0
[PATCH nbdkit 3/3] tests: Test export flags (eflags).
...See also src/protocol.h
+HAS_FLAGS=$(( 1 << 0 ))
+READ_ONLY=$(( 1 << 1 ))
+SEND_FLUSH=$(( 1 << 2 ))
+SEND_FUA=$(( 1 << 3 ))
+ROTATIONAL=$(( 1 << 4 ))
+SEND_TRIM=$(( 1 << 5 ))
+SEND_WRITE_ZEROES=$(( 1 << 6 ))
+
+all_flags="HAS_FLAGS READ_ONLY SEND_FLUSH SEND_FUA ROTATIONAL SEND_TRIM SEND_WRITE_ZEROES"
+
+do_nbdkit ()
+{
+ nbdkit -v -U - -o "$@" sh script=- --run '
+ socat -b 28 unix-connect:$unixsocket \
+ exec:"dd bs=1 skip=26 count=2 of=eflags.out status=none"...
2019 Oct 20
0
[PATCH libnbd] api: Allow NBD URIs to be restricted.
...| 2 +
5 files changed, 186 insertions(+), 5 deletions(-)
diff --git a/generator/generator b/generator/generator
index 6cfe1fd..c2ff0db 100755
--- a/generator/generator
+++ b/generator/generator
@@ -991,7 +991,15 @@ let handshake_flags = {
"NO_ZEROES", 1 lsl 1;
]
}
-let all_flags = [ cmd_flags; handshake_flags ]
+let allow_transport_flags = {
+ flag_prefix = "ALLOW_TRANSPORT";
+ flags = [
+ "TCP", 1 lsl 0;
+ "UNIX", 1 lsl 1;
+ "VSOCK", 1 lsl 2;
+ ]
+}
+let all_flags = [ cmd_flags; handshake_flags; allow_transport_flags...
2019 Aug 10
0
[PATCH libnbd 9/9] FOR DISCUSSION ONLY: api: Add ‘allow’ parameter to nbd_connect_uri to control permitted URIs.
..."%s\n", nbd_get_error ());
exit (EXIT_FAILURE);
}
diff --git a/generator/generator b/generator/generator
index fe24738..5f5523a 100755
--- a/generator/generator
+++ b/generator/generator
@@ -939,7 +939,17 @@ let cmd_flags = {
"REQ_ONE", 1 lsl 3;
]
}
-let all_flags = [ cmd_flags ]
+let connect_uri_allow_flags = {
+ flag_prefix = "CONNECT_URI";
+ all_flags_bitmask = true;
+ flags = [
+ "ALLOW_TCP", 1 lsl 0;
+ "ALLOW_UNIX", 1 lsl 1;
+ "ALLOW_TLS", 1 lsl 2;
+ "REQUIRE_TLS", 1 lsl 3;
+ ]
+}
+l...
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
2018 Dec 14
6
[PATCH nbdkit 0/3] tests: Test export flags (eflags).
Some feature additions to the shell script plugin allow us to test the
export flags field reasonably easily.
Rich.
2020 Sep 11
3
[libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
...state);
extern enum state_group nbd_internal_state_group (enum state state);
diff --git a/generator/API.ml b/generator/API.ml
index 1d920cf..6cdab34 100644
--- a/generator/API.ml
+++ b/generator/API.ml
@@ -181,7 +181,14 @@ let allow_transport_flags = {
"VSOCK", 1 lsl 2;
]
}
-let all_flags = [ cmd_flags; handshake_flags; allow_transport_flags ]
+let shutdown_flags = {
+ flag_prefix = "SHUTDOWN";
+ flags = [
+ "IMMEDIATE", 1 lsl 1;
+ ]
+}
+let all_flags = [ cmd_flags; handshake_flags; allow_transport_flags;
+ shutdown_flags]
let default_cal...
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
0
Re: [libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
..._state_group (enum state state);
> diff --git a/generator/API.ml b/generator/API.ml
> index 1d920cf..6cdab34 100644
> --- a/generator/API.ml
> +++ b/generator/API.ml
> @@ -181,7 +181,14 @@ let allow_transport_flags = {
> "VSOCK", 1 lsl 2;
> ]
> }
> -let all_flags = [ cmd_flags; handshake_flags; allow_transport_flags ]
> +let shutdown_flags = {
> + flag_prefix = "SHUTDOWN";
> + flags = [
> + "IMMEDIATE", 1 lsl 1;
> + ]
> +}
> +let all_flags = [ cmd_flags; handshake_flags; allow_transport_flags;
> +...
2019 Aug 11
0
Re: [PATCH libnbd 9/9] FOR DISCUSSION ONLY: api: Add ‘allow’ parameter to nbd_connect_uri to control permitted URIs.
...Is that intentional that
> passing all flags forbids the use of non-encrypted connections?
Yes I believe it's wrong.
> > +++ b/generator/generator
> > @@ -939,7 +939,17 @@ let cmd_flags = {
> > "REQ_ONE", 1 lsl 3;
> > ]
> > }
> > -let all_flags = [ cmd_flags ]
> > +let connect_uri_allow_flags = {
> > + flag_prefix = "CONNECT_URI";
> > + all_flags_bitmask = true;
> > + flags = [
> > + "ALLOW_TCP", 1 lsl 0;
> > + "ALLOW_UNIX", 1 lsl 1;
> > + "ALLOW_T...
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...]
+}
+let strict_flags = {
+ flag_prefix = "STRICT";
+ flags = [
+ "COMMANDS", 1 lsl 0;
+ ]
}
let allow_transport_flags = {
flag_prefix = "ALLOW_TRANSPORT";
@@ -179,7 +185,8 @@ let allow_transport_flags = {
"VSOCK", 1 lsl 2;
]
}
-let all_flags = [ cmd_flags; handshake_flags; allow_transport_flags ]
+let all_flags = [ cmd_flags; handshake_flags; strict_flags;
+ allow_transport_flags ]
let default_call = { args = []; optargs = []; ret = RErr;
shortdesc = ""; longdesc = ""; exampl...
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 3/5] api: Add nbd_set_strict_mode
...+ ]
+}
+let strict_flags = {
+ flag_prefix = "STRICT";
+ flags = [
+ "COMMANDS", 1 lsl 0;
+ ]
}
let allow_transport_flags = {
flag_prefix = "ALLOW_TRANSPORT";
@@ -187,8 +200,8 @@ let shutdown_flags = {
"IMMEDIATE", 1 lsl 1;
]
}
-let all_flags = [ cmd_flags; handshake_flags; allow_transport_flags;
- shutdown_flags ]
+let all_flags = [ cmd_flags; handshake_flags; strict_flags;
+ allow_transport_flags; shutdown_flags ]
let default_call = { args = []; optargs = []; ret = RErr;
shortd...
2019 Aug 23
1
[libnbd PATCH 1/1] api: Add support for FAST_ZERO flag
..."NO_HOLE", 1 lsl 1;
- "DF", 1 lsl 2;
- "REQ_ONE", 1 lsl 3;
+ "FUA", 1 lsl 0;
+ "NO_HOLE", 1 lsl 1;
+ "DF", 1 lsl 2;
+ "REQ_ONE", 1 lsl 3;
+ "FAST_ZERO", 1 lsl 4;
]
}
let all_flags = [ cmd_flags ]
@@ -1389,6 +1390,19 @@ the server does not."
^ non_blocking_test_call_description;
};
+ "can_fast_zero", {
+ default_call with
+ args = []; ret = RBool;
+ permitted_states = [ Connected; Closed ];
+ shortdesc = "does the server support the fast...
2018 Dec 15
5
[PATCH nbdkit v2 0/4] tests: Test export flags (eflags).
v1 was here:
https://www.redhat.com/archives/libguestfs/2018-December/thread.html#00123
v2:
- Document "-" instead of "script=-" and use it in the test; and
verify this also works on FreeBSD; and verify that it doesn't
depend on the particular behaviour of our wrapper script and should
work with installed nbdkit too.
- Fix handling of zero flags parameter.
-