search for: state_start

Displaying 19 results from an estimated 19 matches for "state_start".

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 1/4] lib: Move nbd_aio_is_* function impls to separate source file.
...100644 --- a/lib/aio.c +++ b/lib/aio.c @@ -48,84 +48,6 @@ 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: -...
2020 Sep 04
0
[libnbd PATCH 2/2] api: Add STRICT_BOUNDS to nbd_set_strict_mode
...andle.c +++ b/lib/handle.c @@ -75,7 +75,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->strict = LIBNBD_STRICT_COMMANDS; + h->strict = LIBNBD_STRICT_COMMANDS | LIBNBD_STRICT_BOUNDS; h->public_state = STATE_START; h->state = STATE_START; diff --git a/lib/rw.c b/lib/rw.c index b5c1698..adfb7ac 100644 --- a/lib/rw.c +++ b/lib/rw.c @@ -278,6 +278,18 @@ nbd_unlocked_aio_pread (struct nbd_handle *h, void *buf, } } + if (h->strict & LIBNBD_STRICT_BOUNDS) { + if (count == 0) { + set_...
2019 Jun 05
0
[PATCH libnbd 2/4] lib: Split nbd_aio_is_* functions into internal.
...12 @@ #include "internal.h" -/* NB: is_locked = false, may_set_error = false. */ -int -nbd_unlocked_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) {...
2019 Jun 05
0
[PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...) == -1) return -1; } diff --git a/lib/handle.c b/lib/handle.c index cc311ba..8bf5280 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -57,7 +57,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->state = STATE_START; + h->state = h->next_state = STATE_START; h->pid = -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 7290247..1bef1c2 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -80,7 +80,17 @@ struct nbd_handle { /* Linked list of close...
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.
2009 Jun 29
0
[PATCH server] REVISED Vm state change auditing/accounting
...STATE_INVALID = "invalid" + ALL_STATES = [STATE_PENDING, + STATE_CREATING, + STATE_RUNNING, + STATE_UNREACHABLE, + STATE_POWERING_OFF, + STATE_STOPPING, + STATE_STOPPED, + STATE_STARTING, + STATE_SUSPENDING, + STATE_SUSPENDED, + STATE_RESUMING, + STATE_SAVING, + STATE_SAVED, + STATE_RESTORING, + STATE_MIGRATING, + STATE_CREATE_FAILED, + STATE_INV...
2009 Jun 24
1
[PATCH server] Vm state change auditing/accounting
...STATE_INVALID = "invalid" + ALL_STATES = [STATE_PENDING, + STATE_CREATING, + STATE_RUNNING, + STATE_UNREACHABLE, + STATE_POWERING_OFF, + STATE_STOPPING, + STATE_STOPPED, + STATE_STARTING, + STATE_SUSPENDING, + STATE_SUSPENDED, + STATE_RESUMING, + STATE_SAVING, + STATE_SAVED, + STATE_RESTORING, + STATE_MIGRATING, + STATE_CREATE_FAILED, + STATE_INV...
2020 Sep 04
4
[RFC libnbd PATCH 0/2] Add knobs for client- vs. server-side validation
We have been inconsistent on how much we reject client-side without even consulting the server, vs. how much we depend on the server to detect failure (even if our request can be deemed undefined per NBD protocol). I'd like to change it so that by default, we reject as much as we can client-side for less traffic, but where the user can also change things on the fly for server-side integration
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...) == -1) return -1; } diff --git a/lib/handle.c b/lib/handle.c index e40b274..300eac7 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -57,7 +57,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->state = STATE_START; + h->state = h->public_state = STATE_START; h->pid = -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 61ddbde..503bf34 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -80,7 +80,17 @@ struct nbd_handle { /* Linked list of clo...
2019 Jun 05
1
[PATCH libnbd v2] lib: Atomically update h->state when leaving the locked region.
...) == -1) return -1; } diff --git a/lib/handle.c b/lib/handle.c index cc311ba..4167b3e 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -57,7 +57,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->state = STATE_START; + h->state = h->public_state = STATE_START; h->pid = -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 5b6152b..ce4bf5b 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -80,7 +80,17 @@ struct nbd_handle { /* Linked list of clo...
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...andle.c b/lib/handle.c index 7987d59..a1fa142 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -75,6 +75,8 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; + h->strict = LIBNBD_STRICT_COMMANDS; + h->public_state = STATE_START; h->state = STATE_START; h->pid = -1; @@ -350,6 +352,20 @@ nbd_unlocked_get_handshake_flags (struct nbd_handle *h) return h->gflags; } +int +nbd_unlocked_set_strict_mode (struct nbd_handle *h, uint32_t flags) +{ + h->strict = flags; + return 0; +} + +/* NB: may_set_error =...
2012 Dec 01
6
[LLVMdev] [RFC] "noclone" function attribute
...PLE ======= Ralf Karrenberg proposed an algorithm which for a kernel like this: kernel void k() { if (x()) y(); barrier(); if (x()) z(); else w(); } split it up into sub-functions and would produce a state machine and a loop similar to this: while (1) { switch (state) { case STATE_START: for (x...) for (y...) for (z...) state = kernel_START(x, y, z); break; case STATE_BARRIER1: for (x...) for (y...) for (z...) state = kernel_BARRIER1(x, y, z); break; case STATE_END: return; } } where every kernel sub-function (kernel_START and kernel_BARRIER1 in this example...
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
2012 Dec 02
0
[LLVMdev] [RFC] "noclone" function attribute
...PLE ======= Ralf Karrenberg proposed an algorithm which for a kernel like this: kernel void k() { if (x()) y(); barrier(); if (x()) z(); else w(); } split it up into sub-functions and would produce a state machine and a loop similar to this: while (1) { switch (state) { case STATE_START: for (x...) for (y...) for (z...) state = kernel_START(x, y, z); break; case STATE_BARRIER1: for (x...) for (y...) for (z...) state = kernel_BARRIER1(x, y, z); break; case STATE_END: return; } } where every kernel sub-function (kernel_START and kernel_BARRIER1 in this example...
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...ib/handle.c b/lib/handle.c index 4d26842..2dc1fb5 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -74,6 +74,8 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; + h->strict = LIBNBD_STRICT_MASK; + h->public_state = STATE_START; h->state = STATE_START; h->pid = -1; @@ -349,6 +351,20 @@ nbd_unlocked_get_handshake_flags (struct nbd_handle *h) return h->gflags; } +int +nbd_unlocked_set_strict_mode (struct nbd_handle *h, uint32_t flags) +{ + h->strict = flags; + return 0; +} + +/* NB: may_set_error =...
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
2008 Mar 21
0
Wine release 0.9.58
...ad of using memcpy. Aric Stewart (9): wineboot: Add Japanese resources. gdi32: Skip leading @ from FontFace when looking for font to load. gdi32: Add loading and processing of GSUB table vert/vrt2 functions for proper tategaki (vertical writing). dsound: Set the status from STATE_STARTING to STATE_PLAYING before mixing our next buffer so that we do not potentially skip early event when starting. regedit: Check for unicode file without using fseek. rebar: In AutoSize get the window rc after REBAR_Layout if needed to respect the sizing changes made by REBAR_Layout....
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2: - now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE - four flags instead of two: STRICT_FLAGS is new (patch 4), and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5) - various refactorings for more shared code and less duplication Eric Blake (5): api: Add xxx_MASK constant for each Flags type generator: Refactor filtering of accepted OFlags api: Add