search for: nbd_internal_state_group

Displaying 12 results from an estimated 12 matches for "nbd_internal_state_group".

2019 Jun 05
0
[PATCH libnbd 1/4] lib: Move nbd_aio_is_* function impls to separate source file.
...g_group (enum state_group group) -{ - switch (group) { - case GROUP_TOP: - return 0; - case GROUP_CONNECT: - case GROUP_CONNECT_TCP: - case GROUP_CONNECT_COMMAND: - case GROUP_MAGIC: - case GROUP_OLDSTYLE: - case GROUP_NEWSTYLE: - return 1; - default: - return is_connecting_group (nbd_internal_state_group_parent (group)); - } -} - -/* NB: is_locked = false, may_set_error = false. */ -int -nbd_unlocked_aio_is_connecting (struct nbd_handle *h) -{ - enum state_group group = nbd_internal_state_group (h->state); - - return is_connecting_group (group); -} - -/* NB: is_locked = false, may_set_error =...
2019 Jun 05
0
[PATCH libnbd 2/4] lib: Split nbd_aio_is_* functions into internal.
...ART; } static int @@ -51,20 +52,18 @@ is_connecting_group (enum state_group group) } } -/* NB: is_locked = false, may_set_error = false. */ -int -nbd_unlocked_aio_is_connecting (struct nbd_handle *h) +bool +nbd_internal_is_state_connecting (enum state state) { - enum state_group group = nbd_internal_state_group (h->state); + enum state_group group = nbd_internal_state_group (state); return is_connecting_group (group); } -/* NB: is_locked = false, may_set_error = false. */ -int -nbd_unlocked_aio_is_ready (struct nbd_handle *h) +bool +nbd_internal_is_state_ready (enum state state) { - return h...
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 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 Jun 05
0
[PATCH libnbd 3/4] lib: Add set_state / get_state macros.
...{ if (nbd_unlocked_poll (h, -1) == -1) return -1; } diff --git a/lib/internal.h b/lib/internal.h index 691a1eb..7290247 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -291,6 +291,9 @@ extern const char *nbd_internal_state_short_string (enum state state); extern enum state_group nbd_internal_state_group (enum state state); extern enum state_group nbd_internal_state_group_parent (enum state_group group); +#define set_state(h,next_state) ((h)->state) = (next_state) +#define get_state(h) ((h)->state) + /* utils.c */ extern void nbd_internal_hexdump (const void *data, size_t len, FILE *fp);...
2019 Jun 05
0
[PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...nd get_state macros in regular code. + */ + _Atomic enum state state; + enum state next_state; bool structured_replies; /* If we negotiated NBD_OPT_STRUCTURED_REPLY */ @@ -291,7 +301,8 @@ extern const char *nbd_internal_state_short_string (enum state state); extern enum state_group nbd_internal_state_group (enum state state); extern enum state_group nbd_internal_state_group_parent (enum state_group group); -#define set_state(h,next_state) ((h)->state) = (next_state) +#define set_next_state(h,_next_state) ((h)->next_state) = (_next_state) +#define get_next_state(h) ((h)->next_state) #defi...
2020 Sep 11
3
[libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
...ern 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; ] } -let all_flags = [ cmd_flags; handshake_flags; allow_transport...
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...blic_state macros in regular code. + */ + _Atomic enum state public_state; + enum state state; bool structured_replies; /* If we negotiated NBD_OPT_STRUCTURED_REPLY */ @@ -292,8 +302,9 @@ extern const char *nbd_internal_state_short_string (enum state state); extern enum state_group nbd_internal_state_group (enum state state); extern enum state_group nbd_internal_state_group_parent (enum state_group group); -#define set_state(h,next_state) ((h)->state) = (next_state) -#define get_state(h) ((h)->state) +#define set_next_state(h,next_state) ((h)->state) = (next_state) +#define get_next_state...
2020 Sep 17
0
Re: [libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
...l_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; > ] > } > -let all_flags =...
2019 Jun 05
1
[PATCH libnbd v2] lib: Atomically update h->state when leaving the locked region.
...blic_state macros in regular code. + */ + _Atomic enum state public_state; + enum state state; bool structured_replies; /* If we negotiated NBD_OPT_STRUCTURED_REPLY */ @@ -291,8 +301,9 @@ extern const char *nbd_internal_state_short_string (enum state state); extern enum state_group nbd_internal_state_group (enum state state); extern enum state_group nbd_internal_state_group_parent (enum state_group group); -#define set_state(h,next_state) ((h)->state) = (next_state) -#define get_state(h) ((h)->state) +#define set_next_state(h,next_state) ((h)->state) = (next_state) +#define get_next_state...
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 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