search for: state_machine

Displaying 20 results from an estimated 57 matches for "state_machine".

2020 Sep 28
0
[libnbd PATCH 2/3] generator: Rename OPT_SET_META_CONTEXT states
Drop the SET designation, so that we can reuse these states for OPT_LIST_META_CONTEXT in the next patch. --- generator/Makefile.am | 4 +-- generator/state_machine.ml | 6 ++--- ...t.c => states-newstyle-opt-meta-context.c} | 26 +++++++++---------- .../states-newstyle-opt-structured-reply.c | 4 +-- generator/states-newstyle.c | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) rename generator/{states-ne...
2010 Aug 10
4
(Dreaded) STI, belongs_to
...pes of school scholarships. Each scholarship goes through a different review process, represented by a state machine (this is not a state machine question). So there are two state machine classes that differ slightly and subclass a generic StateMachine: class ScholarshipApplication belongs_to :state_machine end class StateMachine end class StateA < StateMachine has_one :application end class StateB < StateMachine has_one :application end The problem is I can get a ScholarshipApplication instance to tell me its StateMachine, but the StateMachine can''t tell me it''s Schola...
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
...clear_meta_contexts generator: Rename OPT_SET_META_CONTEXT states api: Add nbd_opt_list_meta_context lib/internal.h | 1 + generator/API.ml | 162 +++++++++++++++++- generator/Makefile.am | 4 +- generator/state_machine.ml | 6 +- ...t.c => states-newstyle-opt-meta-context.c} | 106 ++++++++---- .../states-newstyle-opt-structured-reply.c | 4 +- generator/states-newstyle.c | 5 +- lib/handle.c | 32 ++++ lib/opt.c...
2020 Jul 24
4
[libnbd PATCH 0/3] Expose server block size constraints
...ew API to query negotiated block size nbdinfo: Expose block size constraints info/nbdinfo.pod | 6 +++ lib/internal.h | 7 +++ lib/nbd-protocol.h | 10 ++++- generator/API.ml | 70 +++++++++++++++++++++++++++--- generator/state_machine.ml | 7 +++ generator/states-newstyle-opt-go.c | 31 +++++++++++-- lib/flags.c | 18 +++++++- info/nbdinfo.c | 18 ++++++++ 8 files changed, 156 insertions(+), 11 deletions(-) -- 2.27.0
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...e to get back to negotiating or connected states. --- lib/internal.h | 4 + generator/API.ml | 93 +++++++++++++++++-- generator/API.mli | 1 + generator/C.ml | 4 +- generator/state_machine.ml | 26 ++++++ generator/states-magic.c | 6 +- generator/states-newstyle-opt-go.c | 4 + .../states-newstyle-opt-structured-reply.c | 7 +- generator/states-newstyle.c | 47 ++++++++-- lib/connect.c...
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...means you HAVE to kill the connection without a data phase; that will be rectified in the next patch adding nbd_opt_go. But breaking the patches up makes review easier. --- lib/internal.h | 1 + generator/API.ml | 35 ++++++- generator/state_machine.ml | 26 +++++ generator/states-magic.c | 6 +- generator/states-newstyle-opt-go.c | 2 +- generator/states-newstyle-opt-starttls.c | 4 +- .../states-newstyle-opt-structured-reply.c | 7 +- generator/states-newstyle.c...
2020 Mar 30
4
[libnbd PATCH 0/2] fix hangs against nbdkit 1.2
...s restoring the shutdown(SHUT_WR) call that got lost from plugins/nbd/nbd.c when nbdkit switched to libnbd in commit ab7760fc. Eric Blake (2): sockets: Add .shut_writes callback states: Add state for shutdown/gnutls_bye after NBD_CMD_DISC lib/internal.h | 4 +++- generator/state_machine.ml | 19 +++++++++++++++++-- generator/states-issue-command.c | 20 ++++++++++++++++++-- lib/crypto.c | 21 +++++++++++++++++---- lib/socket.c | 12 +++++++++++- 5 files changed, 66 insertions(+), 10 deletions(-) -- 2.26.0.rc2
2020 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...s. --- .gitignore | 1 + examples/Makefile.am | 14 +++ examples/list-exports.c | 108 +++++++++++++++++++ generator/API.ml | 72 +++++++++++++ generator/Makefile.am | 1 + generator/state_machine.ml | 39 +++++++ generator/states-newstyle-opt-list.c | 131 +++++++++++++++++++++++ generator/states-newstyle-opt-starttls.c | 8 +- lib/handle.c | 50 +++++++++ lib/internal.h | 9 ++ lib/nbd-protocol.h...
2019 Nov 15
1
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...uot;LISTEN_PID=..." which is filled in by @@ -45,7 +47,6 @@ static char ** prepare_socket_activation_environment (void) { - extern char **environ; char **env = NULL; char *p0 = NULL, *p1 = NULL; size_t i, len; @@ -97,7 +98,6 @@ prepare_socket_activation_environment (void) STATE_MACHINE { CONNECT_SA.START: -#ifdef HAVE_EXECVPE int s; struct sockaddr_un addr; char **env; @@ -200,7 +200,8 @@ STATE_MACHINE { /* Restore SIGPIPE back to SIG_DFL. */ signal (SIGPIPE, SIG_DFL); - execvpe (h->argv[0], h->argv, env); + environ = env; + execvp (h-&g...
2020 Jul 20
2
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
Proposal for new APIs to list exports. The general shape of the API can probably best be seen from the examples/list-exports.c example. Rich.
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...een added to any released version so far. diff --git a/generator/states-newstyle-opt-meta-context.c b/generator/states-newstyle-opt-meta-context.c index 0dc48af..ce878ee 100644 --- a/generator/states-newstyle-opt-meta-context.c +++ b/generator/states-newstyle-opt-meta-context.c @@ -21,18 +21,28 @@ STATE_MACHINE { NEWSTYLE.OPT_META_CONTEXT.START: size_t i, nr_queries; - uint32_t len; + uint32_t len, opt; /* If the server doesn't support SRs then we must skip this group. * Also we skip the group if the client didn't request any metadata - * contexts. + * contexts, when doing SET (...
2023 Jun 09
4
[libnbd PATCH v4 0/4] Saner reply header layout
...(4): states: Document our reliance on type overlaps generator: Finish parsing structured header in states-reply.c generator: Rename states-reply-structured to states-reply-chunk internal: Refactor layout of replies in sbuf lib/internal.h | 16 ++- generator/state_machine.ml | 53 ++++--- generator/states-reply.c | 65 +++++++-- ...eply-structured.c => states-reply-chunk.c} | 129 ++++++++---------- generator/states-reply-simple.c | 4 +- generator/Makefile.am | 2 +- 6 files chan...
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
...nternal.h | 45 +- lib/nbd-protocol.h | 10 +- generator/API.ml | 478 +++++++++++++----- generator/API.mli | 1 + generator/C.ml | 4 +- generator/state_machine.ml | 37 +- generator/states-magic.c | 6 +- generator/states-newstyle-opt-go.c | 88 +++- generator/states-newstyle-opt-list.c | 83 ++- .../states-newstyle-opt-set-meta-context.c | 4 +- generator/states-newstyle-opt-starttls.c...
2012 Dec 04
0
Empty test suite is run after every rake task
..."starling" gem ''selenium-client'', ''1.2.18'' gem ''selenium-webdriver'', ''2.25.0'' gem ''iso8583'', ''0.1.3'' # ---------------------- # plugin gems # ---------------------- gem ''state_machine'', :path => ''vendor/cache/git/state_machine'' # :git => ''git://github.com/pluginaweek/state_machine.git'' # ---------------------- gem ''simple_enum'' gem ''meta_search'' gem ''meta_where'' gem '&...
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
.... More comments inline below ... On Mon, Aug 10, 2020 at 09:09:11PM -0500, Eric Blake wrote: > diff --git a/generator/states-magic.c b/generator/states-magic.c > index 944728d..2ad3a96 100644 > --- a/generator/states-magic.c > +++ b/generator/states-magic.c ... > @@ -42,8 +42,10 @@ STATE_MACHINE { > } > > version = be64toh (h->sbuf.new_handshake.version); > - if (version == NBD_NEW_VERSION) > + if (version == NBD_NEW_VERSION) { > + h->sbuf.option.option = 0; > SET_NEXT_STATE (%.NEWSTYLE.START); > + } > else if (version == NBD_OLD_VERSIO...
2019 Oct 18
5
[PATCH libnbd 0/2] api: Add support for AF_VSOCK.
This is a series of patches to libnbd and nbdkit adding AF_VSOCK support. On the host side it allows you to start an nbdkit instance which listens on a virtio-vsock socket: $ ./nbdkit -fv --vsock memory 1G ... nbdkit: debug: bound to vsock 2:10809 On the guest side you can then use libnbd to connect to the server: $ ./run nbdsh -c 'h.connect_vsock(2, 10809)' -c
2020 Aug 18
3
[libnbd PATCH v3 0/2] Implementing NBD_OPT_LIST
...nt of figuring out where my work-in-progress posted in patches 12-13 of v2 was going wrong. Eric Blake (2): api: Add nbd_opt_list api: Add nbd_aio_opt_list lib/internal.h | 28 +-- generator/API.ml | 152 +++++++--------- generator/state_machine.ml | 4 +- generator/states-newstyle-opt-list.c | 82 ++++----- generator/states-newstyle-opt-starttls.c | 8 +- generator/states-newstyle.c | 3 + generator/states.c | 18 +- lib/handle.c...
2023 Aug 03
1
[libnbd PATCH v4 20/25] generator: Actually request extended headers
...ra level of work. Signed-off-by: Eric Blake <eblake at redhat.com> Reviewed-by: Richard W.M. Jones <rjones at redhat.com> --- v4: expand commit message to document other alternatives I did not code up --- generator/API.ml | 87 ++++++++--------- generator/state_machine.ml | 41 ++++++++ .../states-newstyle-opt-extended-headers.c | 94 +++++++++++++++++++ generator/states-newstyle-opt-starttls.c | 6 +- generator/Makefile.am | 1 + 5 files changed, 184 insertions(+), 45 deletions(-) create mode 100644 generator...
2020 Aug 11
3
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...gt; > On Mon, Aug 10, 2020 at 09:09:11PM -0500, Eric Blake wrote: >> diff --git a/generator/states-magic.c b/generator/states-magic.c >> index 944728d..2ad3a96 100644 >> --- a/generator/states-magic.c >> +++ b/generator/states-magic.c > ... >> @@ -42,8 +42,10 @@ STATE_MACHINE { >> } >> >> version = be64toh (h->sbuf.new_handshake.version); >> - if (version == NBD_NEW_VERSION) >> + if (version == NBD_NEW_VERSION) { >> + h->sbuf.option.option = 0; >> SET_NEXT_STATE (%.NEWSTYLE.START); >> + } >>...
2019 Oct 18
0
[PATCH libnbd 2/2] api: Add support for AF_VSOCK.
...+ | CmdConnectVSock (* [nbd_aio_connect_vsock] *) | CmdConnectTCP (* [nbd_aio_connect_tcp] *) | CmdConnectCommand (* [nbd_aio_connect_command] *) | CmdConnectSA (* [nbd_aio_connect_systemd_socket_activation]*) @@ -169,6 +170,7 @@ let rec state_machine = [ external_events = [ CmdCreate, ""; CmdConnectSockAddr, "CONNECT.START"; CmdConnectUnix, "CONNECT_UNIX.START"; + CmdConnectVSock, "CONNECT_VSOCK.START";...