search for: permitted_st

Displaying 20 results from an estimated 121 matches for "permitted_st".

2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...and cbarg = | CBString of string (* like String *) | CBUInt of string (* like UInt *) | CBUInt64 of string (* like UInt64 *) +and flags = { + flag_prefix : string; (* prefix of each flag name *) + flags : (string * int) list (* flag names and their values in C *) +} and permitted_state = | Created (* can be called in the START state *) | Connecting (* can be called when connecting/handshaking *) @@ -906,6 +910,18 @@ let non_blocking_test_call_description = "\n This call does not block, because it returns data that is saved in the handle...
2019 Aug 13
0
[PATCH libnbd 1/6] generator: Share single list of all Closures.
..."count"); - CBUInt64 "offset"; CBUInt "status"; - CBMutable (Int "error")] } ]; + Closure chunk_closure ]; optargs = [ OFlags ("flags", cmd_flags) ]; ret = RErr; permitted_states = [ Connected ]; @@ -1641,13 +1663,7 @@ punching a hole."; "block_status", { default_call with - args = [ UInt64 "count"; UInt64 "offset"; - Closure { cbname="extent"; - cbargs=[CBString "metacontex...
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...int *) | UInt64 of string (* 64 bit unsigned int *) +and optarg = +| OFlags of string (* NBD_CMD_FLAG_* flags *) and ret = | RBool (* return a boolean, or error *) | RStaticString (* return a static string (must be located in @@ -895,7 +897,7 @@ and permitted_state = not including CLOSED or DEAD *) | Closed | Dead (* can be called when the handle is CLOSED or DEAD *) -let default_call = { args = []; ret = RErr; +let default_call = { args = []; optargs = []; ret = RErr; shortdesc = "&qu...
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...silently accept flag DF, but it really only makes sense + * with callbacks, because otherwise there is no observable change + * except that the server may fail where it would otherwise succeed. + *) + optargs = [ OFlags ("flags", cmd_flags, Some []) ]; ret = RErr; permitted_states = [ Connected ]; shortdesc = "read from the NBD server"; @@ -1509,7 +1513,7 @@ protocol extensions)."; default_call with args = [ BytesOut ("buf", "count"); UInt64 "offset"; Closure chunk_closure ]; - optargs = [ OFlag...
2019 Aug 09
4
[PATCH libnbd 0/2] generator: Preparatory changes to the generator.
These are some simplifications to the generator. They don't probably make much sense on their own, but they are preparatory to better handling of enums, and or'd lists of flags. Rich.
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...iff --git a/generator/generator b/generator/generator index 468292f..c1f4c29 100755 --- a/generator/generator +++ b/generator/generator @@ -811,9 +811,10 @@ type call = { longdesc : string; (* long description *) (* List of permitted states for making this call. [[]] = Any state. *) permitted_states : permitted_state list; - (* Most functions must take a lock. The only known exception is - * for a function which {b only} reads from the atomic [h->state] - * field and does nothing else with the handle. + (* Most functions must take a lock. The only known exceptions are: + * - f...
2020 Aug 19
3
[libnbd PATCH 0/2] NBD_OPT_INFO support
This replaces 13/13 of my v2 series; and now that it has pretty good testsuite coverage and demonstrable performance improvement to nbdinfo, I'm going ahead and pushing this now. We may still want to add further nbd_opt_* commands for other fine-grained tuning of negotiation, but for now, I think things have stabilized on this end, and I can return to polishing .list_exports on the nbdkit
2019 Aug 13
0
[PATCH libnbd 6/6] lib: Make all completion callbacks into OClosures.
...Closure completion_closure ]; - optargs = [ OFlags ("flags", cmd_flags) ]; + args = [ BytesPersistOut ("buf", "count"); UInt64 "offset" ]; + optargs = [ OClosure completion_closure; OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; shortdesc = "read from the NBD server, with callback on completion"; @@ -1874,9 +1873,8 @@ documented in C<nbd_pread_structured>."; "aio_pread_structured_callback", { default_call with args = [ BytesPersistOut ("buf", &...
2019 Aug 13
0
[PATCH libnbd v2 2/3] lib: Make all completion callbacks into OClosures.
...Closure completion_closure ]; - optargs = [ OFlags ("flags", cmd_flags) ]; + args = [ BytesPersistOut ("buf", "count"); UInt64 "offset" ]; + optargs = [ OClosure completion_closure; OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; shortdesc = "read from the NBD server, with callback on completion"; @@ -1874,9 +1873,8 @@ documented in C<nbd_pread_structured>."; "aio_pread_structured_callback", { default_call with args = [ BytesPersistOut ("buf", &...
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...ate state); extern bool nbd_internal_is_state_processing (enum state state); extern bool nbd_internal_is_state_dead (enum state state); diff --git a/generator/API.ml b/generator/API.ml index 82fdf75..ff7f4c1 100644 --- a/generator/API.ml +++ b/generator/API.ml @@ -90,6 +90,7 @@ and flags = { and permitted_state = | Created | Connecting +| Negotiating | Connected | Closed | Dead and link = @@ -268,7 +269,7 @@ C<\"nbd2\">, etc."; "set_export_name", { default_call with args = [ String "export_name" ]; ret = RErr; - permitted_states = [ Created...
2019 Jun 08
4
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...com/archives/libguestfs/2019-June/thread.html#00055 v2 was here: https://www.redhat.com/archives/libguestfs/2019-June/thread.html#00067 v3: - Fix atomicly -> atomically in commit message. - Fix a comment. - Fix TOCTTOU: There is now an inline function generated called <name>_is_permitted_state, and this is called twice, first outside the lock for the quick rejection check, and again inside the lock in case the state changed. I think an improvement would be to _drop_ the first check (outside the lock). This is an error check, so not performance critical since we are definitely...
2019 Aug 09
1
Re: [PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...position only" > - name > + function > + | _, { optargs = [] } | _, { optargs = [OFlags _] } -> () > + | (name, _) -> > + failwithf "%s: optargs can only be empty list of [OFlags]" name s/of/or/ > @@ -3554,7 +3569,7 @@ let permitted_state_text permitted_states = > *) > let generate_lib_api_c () = > (* Print the wrapper added around all API calls. *) > - let rec print_wrapper (name, {args; ret; permitted_states; > + let rec print_wrapper (name, {args; optargs; ret; permitted_states; >...
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
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):
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
.../generator @@ -1829,108 +1829,60 @@ on the connection."; }; "aio_pread", { - default_call with - args = [ BytesPersistOut ("buf", "count"); UInt64 "offset" ]; - optargs = [ OFlags ("flags", cmd_flags) ]; - ret = RInt64; - permitted_states = [ Connected ]; - shortdesc = "read from the NBD server"; - longdesc = "\ -Issue a read command to the NBD server. This returns the -unique positive 64 bit cookie for this command, or C<-1> on -error. To check if the command completed, call -C<nbd_aio_command_co...
2019 Jul 16
2
[PATCH libnbd] generator: Define new Closure type
** INCOMPLETE ** This is the generator change as discussed on the list already. The Python and OCaml bindings are not yet done. It passes all [C only] tests and valgrind. Note that nbd_add_close_callback is inconsistent with other closure types because it passes the user_data parameter after the function. (This is not caused by the current patch, it was already inconsistent). We decided that
2019 Aug 13
2
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
This applies on top of the OClosure v2 series posted a few minutes ago. Rich.
2019 Aug 13
12
[PATCH 0/6] Implement OClosure.
Patches 1-4 are basically uncontroversial, straightforward refactoring and IMHO we should just push them. Possibly 1-3 should be squashed together, but I posted them separately so they are easier to review. Patches 5 and 6 together implement OClosure. Patch 5 adds the feature and is simple to understand. Patch 6 changes the Closure completion callbacks into OClosure, but because it doesn't
2019 Jul 30
3
[PATCH libnbd] lib: Remove cookie parameter from completion callbacks.
..."offset"; Closure { cbname="callback"; - cbargs=[Int64 "cookie"; Mutable (Int "error")] }; + cbargs=[Mutable (Int "error")] }; Flags "flags" ]; ret = RInt64; permitted_states = [ Connected ]; @@ -1737,8 +1737,11 @@ C<nbd_pread>."; longdesc = "\ Issue a read command to the NBD server. This returns the unique positive 64 bit cookie for this command, or C<-1> on -error. If this command returns a cookie, then C<callback> +error. + +W...
2019 Aug 09
0
[PATCH libnbd 1/2] generator: Handle closure args (cbargs) specially.
...ytesIn *) +| CBInt of string (* like Int *) +| CBInt64 of string (* like Int64 *) +| CBMutable of arg (* mutable argument, eg. int* *) +| CBString of string (* like String *) +| CBUInt of string (* like UInt *) +| CBUInt64 of string (* like UInt64 *) and permitted_state = | Created (* can be called in the START state *) | Connecting (* can be called when connecting/handshaking *) @@ -932,7 +939,7 @@ Return the state of the debug flag on this handle."; "set_debug_callback", { default_call with args = [...