search for: nbd_internal_state_short_string

Displaying 16 results from an estimated 16 matches for "nbd_internal_state_short_string".

2019 Jun 05
0
[PATCH libnbd 3/4] lib: Add set_state / get_state macros.
...um; - pr " if (h->state != next_state) {\n"; + pr " if (get_state (h) != next_state) {\n"; pr " debug (h, \"transition: %%s -> %%s\",\n"; pr " \"%s\",\n" display_name; pr " nbd_internal_state_short_string (next_state));\n"; - pr " h->state = next_state;\n"; + pr " set_state (h, next_state);\n"; pr " }\n"; pr " return r;\n"; pr "}\n"; @@ -2434,7 +2434,7 @@ let generate_lib_states_c () = pr " bool...
2019 Jun 05
0
[PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...pr " if (get_state (h) != next_state) {\n"; + pr " if (get_next_state (h) != next_state) {\n"; pr " debug (h, \"transition: %%s -> %%s\",\n"; pr " \"%s\",\n" display_name; pr " nbd_internal_state_short_string (next_state));\n"; - pr " set_state (h, next_state);\n"; + pr " set_next_state (h, next_state);\n"; pr " }\n"; pr " return r;\n"; pr "}\n"; @@ -2434,7 +2434,7 @@ let generate_lib_states_c () = pr "...
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...pr " if (get_state (h) != next_state) {\n"; + pr " if (get_next_state (h) != next_state) {\n"; pr " debug (h, \"transition: %%s -> %%s\",\n"; pr " \"%s\",\n" display_name; pr " nbd_internal_state_short_string (next_state));\n"; - pr " set_state (h, next_state);\n"; + pr " set_next_state (h, next_state);\n"; pr " }\n"; pr " return r;\n"; pr "}\n"; @@ -2468,7 +2469,7 @@ let generate_lib_states_c () = pr "...
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.
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
1
[PATCH libnbd v2] lib: Atomically update h->state when leaving the locked region.
...pr " if (get_state (h) != next_state) {\n"; + pr " if (get_next_state (h) != next_state) {\n"; pr " debug (h, \"transition: %%s -> %%s\",\n"; pr " \"%s\",\n" display_name; pr " nbd_internal_state_short_string (next_state));\n"; - pr " set_state (h, next_state);\n"; + pr " set_next_state (h, next_state);\n"; pr " }\n"; pr " return r;\n"; pr "}\n"; @@ -2437,7 +2437,7 @@ let generate_lib_states_c () = pr "...
2023 Jun 12
1
[PATCH libnbd 2/2] generator: state machine: Be less verbose in debug messages
...uot;; > pr " );\n"; > pr " if (get_next_state (h) != next) {\n"; > - pr " debug (h, \"transition: %%s -> %%s\",\n"; > - pr " \"%s\",\n" display_name; > - pr " nbd_internal_state_short_string (next));\n"; > pr " set_next_state (h, next);\n"; > pr " }\n"; > pr " return r;\n"; > @@ -423,15 +420,6 @@ let > pr " case %s:\n" (c_string_of_external_event e); > if state != next_...
2019 Jun 05
0
[PATCH libnbd 2/4] lib: Split nbd_aio_is_* functions into internal.
...uot; set_error (nbd_aio_is_created (h) ? ENOTCONN : EINVAL,\n"; + pr " set_error (nbd_internal_is_state_created (state) ? ENOTCONN : EINVAL,\n"; pr " \"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/c...
2019 May 22
0
[libnbd PATCH v3 2/7] commands: Allow for a command queue
...ht *cmd; + struct command_in_flight *cmd, *prev_cmd; + + if (!nbd_unlocked_aio_is_ready (conn) && + !nbd_unlocked_aio_is_processing (conn)) { + set_error (0, "command request %s is invalid in state %s", + nbd_internal_name_of_nbd_cmd (type), + nbd_internal_state_short_string (conn->state)); + return -1; + } switch (type) { /* Commands which send or receive data are limited to MAX_REQUEST_SIZE. */ @@ -299,10 +308,23 @@ nbd_internal_command_common (struct nbd_connection *conn, if (conn->structured_replies && cmd->data && type == N...
2019 Jun 05
2
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...ged, 38 insertions(+), 24 deletions(-) > > @@ -2462,7 +2462,7 @@ let generate_lib_states_c () = > pr " }\n"; > pr "\n"; > pr " set_error (EINVAL, \"external event %%d is invalid in state %%s\",\n"; > - pr " ev, nbd_internal_state_short_string (get_state (h)));\n"; > + pr " ev, nbd_internal_state_short_string (get_next_state (h)));\n"; I'm also wondering if we should treat external events more like interrupts, where calling nbd_aio_notify_read() in an incorrect state succeeds by setting a flag that is...
2023 Jun 12
3
[PATCH libnbd 0/2] Two simple patches
These patches aren't related to each other, but both are quite simple. The second one requires particular attention - it's my experience that printing out the state transitions in debug mode has never helped me to diagnose a bug, but it has made the debug logs huge and hard to follow. However that might just be me! Has it helped anyone else? Also I'm open to the concept of debug
2019 May 22
8
[PATCH libnbd v2 0/6] Test connection states.
Patch 1/6 was posted before and I didn't change it: https://www.redhat.com/archives/libguestfs/2019-May/thread.html#00134 That doesn't necessarily mean I shouldn't change it, I'm posting it again because the other patches depend on it. The main change in this series is we add three new API functions: nbd_aio_is_created - connection has just been created
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples have been updated, but it demonstrates an idea: Should we forget about the concept of having multiple connections managed under a single handle? In this patch there is a single ‘struct nbd_handle *’ which manages a single state machine and connection (and therefore no nbd_connection). To connect to a multi-conn server you must
2020 Sep 11
3
[libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
...h, struct socket *nbd_internal_socket_create (int fd); /* states.c */ +extern void nbd_internal_abort_commands (struct nbd_handle *h, + struct command **list); extern int nbd_internal_run (struct nbd_handle *h, enum external_event ev); extern const char *nbd_internal_state_short_string (enum state 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;...
2020 Sep 17
0
Re: [libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
...l_socket_create (int fd); > > /* states.c */ > +extern void nbd_internal_abort_commands (struct nbd_handle *h, > + struct command **list); > extern int nbd_internal_run (struct nbd_handle *h, enum external_event ev); > extern const char *nbd_internal_state_short_string (enum state 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 = { &gt...
2019 May 22
12
[libnbd PATCH v3 0/7] Avoid deadlock with in-flight commands
Since v2: - rebase to Rich's new API calls - more refactoring in patch 1 (retitled) - new patches 3 and 4 - fix data corruption in patch 6 (was 4) - more tweaks to the reproducer example (including using new API from 3) Eric Blake (7): lib: Refactor command_common() to do more common work commands: Allow for a command queue commands: Expose FIFO ordering of server completions