Displaying 9 results from an estimated 9 matches for "nbd_internal_state_group_parent".
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 = false....
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.
...f --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);
extern size_t nbd_internal_string_list_length (char **argv);
diff --git a/l...
2019 Jun 05
0
[PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...e;
+ 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)
#define get_state(h) ((h)->state)
/* utils.c */
diff --git a/lib/rw.c b/lib/...
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
..._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(h) ((h)->state)
+#define get_public_state(h) ((h)->public_state)
/*...
2019 Jun 05
1
[PATCH libnbd v2] lib: Atomically update h->state when leaving the locked region.
..._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(h) ((h)->state)
+#define get_public_state(h) ((h)->public_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