Displaying 9 results from an estimated 9 matches for "permitted_state_text".
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...ection_state (struct nbd_handle *h)\n";
pr "{\n";
- pr " switch (get_state (h))\n";
+ pr " switch (get_next_state (h))\n";
pr " {\n";
List.iter (
fun ({ comment; parsed = { display_name; state_enum } }) ->
@@ -2842,6 +2843,33 @@ let permitted_state_text permitted_states =
let generate_lib_api_c () =
let print_wrapper (name, {args; ret; permitted_states;
is_locked; may_set_error}) =
+ if permitted_states <> [] then (
+ pr "static inline bool\n";
+ pr "%s_in_permitted_state (struct n...
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 Jun 08
4
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
v1 was here:
https://www.redhat.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
2019 Jun 05
0
[PATCH libnbd 2/4] lib: Split nbd_aio_is_* functions into internal.
...\"invalid state: %%s: the handle must be %%s\",\n";
- pr " nbd_internal_state_short_string (h->state),\n";
+ pr " nbd_internal_state_short_string (state),\n";
pr " \"%s\");\n" (permitted_state_text permitted_states);
pr " return %s;\n" errcode;
pr " }\n";
diff --git a/lib/connect.c b/lib/connect.c
index 50ec58a..63d2234 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -38,16 +38,16 @@
static int
error_unless_ready (struct nbd_handle *h)
{
- if (nbd_u...
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 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...) ->
- print_extern ("unlocked_" ^ name) args ret
+ fun (name, { args; optargs; ret }) ->
+ print_extern ("unlocked_" ^ name) args optargs ret
) handle_calls;
pr "\n";
pr "#endif /* LIBNBD_UNLOCKED_H */\n"
@@ -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;
is_locked; may_set_error}) =...
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...and READY or processing, but
not including CLOSED or DEAD *)
| Closed | Dead (** can be called when the handle is
diff --git a/generator/C.ml b/generator/C.ml
index afb8142..6b65f6e 100644
--- a/generator/C.ml
+++ b/generator/C.ml
@@ -397,7 +397,8 @@ let permitted_state_text permitted_states =
function
| Created -> "newly created"
| Connecting -> "connecting"
- | Connected -> "connected and finished handshaking with the server"
+ | Negotiating -> "negotiating"
+ |...
2019 Jun 05
9
[PATCH libnbd 0/4] lib: Atomically update h->state.
I need to think about this patch series a bit more, but it
does at least pass the tests.
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):