search for: state_group

Displaying 14 results from an estimated 14 matches for "state_group".

2019 Jun 05
0
[PATCH libnbd 1/4] lib: Move nbd_aio_is_* function impls to separate source file.
...nbd_unlocked_aio_notify_write (struct nbd_handle *h) return nbd_internal_run (h, notify_write); } -/* NB: is_locked = false, may_set_error = false. */ -int -nbd_unlocked_aio_is_created (struct nbd_handle *h) -{ - return h->state == STATE_START; -} - -static int -is_connecting_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_...
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 05
0
[PATCH libnbd 2/4] lib: Split nbd_aio_is_* functions into internal.
...locked_aio_is_created (struct nbd_handle *h) +/* Internal functions to test state or groups of states. */ + +bool +nbd_internal_is_state_created (enum state state) { - return h->state == STATE_START; + return state == STATE_START; } 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_interna...
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
2006 Feb 04
4
AJAX rendered select doesn''t get submitted
...ot;''country_code='' + value") %> _______________________________________________________________________________ StateController#filtered_state_select def filtered_state_select #ajax action country = Country.find_by_code(@params["country_code"]) @state_groups = StateGroup.find_all_by_country_id(country.id) @state_groups.each {|g| g.name = ''- '' + g.name + '' -''} render(:partial => ''options'') end _______________________________________________________________________________ _optio...
2019 Jun 05
0
[PATCH libnbd 3/4] lib: Add set_state / get_state macros.
...state (h))) { 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 *dat...
2019 Jun 05
0
[PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...next_state and 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) ((...
2019 May 30
3
[PATCH libnbd 0/2] Avoid lock and error overhead on some calls.
This works. I'm in the middle of testing whether there is any noticable benefit. Rich.
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...e and get_public_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...
2019 Jun 05
1
[PATCH libnbd v2] lib: Atomically update h->state when leaving the locked region.
...e and get_public_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...
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
2020 Sep 11
3
[libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
...es.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; ] } -let all_flags = [ cmd_flags; handsha...
2020 Sep 17
0
Re: [libnbd PATCH] api: Add LIBNBD_SHUTDOWN_IMMEDIATE flag
...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; > ] >...