Displaying 20 results from an estimated 30 matches for "notifyread".
2019 Jun 19
4
[libnbd PATCH] states: Never block state machine inside REPLY
When processing a server reply within the REPLY subgroup, we will
often hit a situation where recv() requires us to block until the next
NotifyRead. But since NotifyRead is the only permitted external action
while in this group, we are effectively blocking CmdIssue and
NotifyWrite events from happening until the server finishes the
in-progress reply, even though those events have no strict dependence
on the server's progress.
The solution...
2019 Jun 25
0
Re: [libnbd PATCH] states: Never block state machine inside REPLY
...0755
> --- a/generator/generator
> +++ b/generator/generator
> @@ -682,14 +682,14 @@ and reply_state_machine = [
> default_state with
> name = "START";
> comment = "Prepare to receive a reply from the remote server";
> - external_events = [ NotifyRead, "" ];
> + external_events = [];
> };
>
> State {
> default_state with
> name = "RECV_REPLY";
> comment = "Receive a reply from the remote server";
> - external_events = [ NotifyRead, "" ];
> + externa...
2019 May 19
5
[libnbd PATCH 0/4] Various interop fixes
Some of these affect attempts to connect to older qemu-nbd versions,
some of them were triggered by manual edits to qemu-nbd source code to
provoke various other compliant (if uncommon) server behaviors.
Eric Blake (4):
starttls: Skip error payload if falling back to unencrypted
states: Reject payload to NBD_REP_ACK
meta-context: Skip error payload if server lacks meta_context
states: Add
2019 May 21
0
[libnbd PATCH 3/3] states: Allow in-flight read while writing next command
...@@ and issue_command_state_machine = [
default_state with
name = "SEND_REQUEST";
comment = "Sending a request to the remote server";
- external_events = [ NotifyWrite, "" ];
+ external_events = [ NotifyWrite, "";
+ NotifyRead, "PAUSE_SEND_REQUEST" ];
+ };
+
+ State {
+ default_state with
+ name = "PAUSE_SEND_REQUEST";
+ comment = "Interrupt send request to receive an earlier command's reply";
+ external_events = [];
};
State {
@@ -648,7 +656,15 @@ and issue_command_...
2019 May 22
0
[libnbd PATCH v2 4/5] states: Allow in-flight read while writing next command
...@@ and issue_command_state_machine = [
default_state with
name = "SEND_REQUEST";
comment = "Sending a request to the remote server";
- external_events = [ NotifyWrite, "" ];
+ external_events = [ NotifyWrite, "";
+ NotifyRead, "PAUSE_SEND_REQUEST" ];
+ };
+
+ State {
+ default_state with
+ name = "PAUSE_SEND_REQUEST";
+ comment = "Interrupt send request to receive an earlier command's reply";
+ external_events = [];
};
State {
@@ -648,7 +650,15 @@ and issue_command_...
2019 Jun 08
0
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...uld do all of the above in generated code.
The only potential problem I can think of at the moment is the usual
one with interrupts which is that second and subsequent interrupts are
lost if the first interrupt hasn't been processed. However for the
external events we have at the moment:
| NotifyRead (* fd becomes ready to read *)
| NotifyWrite (* fd becomes ready to write *)
| CmdCreate (* [nbd_create] function called *)
| CmdConnectSockAddr (* [nbd_aio_connect] function called *)
| CmdConnectUnix (* [nbd_aio_conn...
2019 Jun 14
1
[libnbd PATCH] states: Validate error message size
...| 1 +
3 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/generator/generator b/generator/generator
index 3b0ca82..deb77f0 100755
--- a/generator/generator
+++ b/generator/generator
@@ -771,6 +771,13 @@ and structured_reply_state_machine = [
external_events = [ NotifyRead, "" ];
};
+ State {
+ default_state with
+ name = "RECV_ERROR_TAIL";
+ comment = "Receive a structured reply error tail";
+ external_events = [ NotifyRead, "" ];
+ };
+
State {
default_state with
name = "RECV_OFFSET_DATA&qu...
2019 May 21
9
[libnbd PATCH 0/3] Avoid deadlock with in-flight commands
...an 256k (enough for the Linux kernel to block the
server until libnbd read()s), immediately followed by nbd_aio_pwrite
for a request larger than 256k (enough to block libnbd until the
server read()s, but the serialized server won't read until we parse
off the reply). My solution was to allow a notifyread at any time we
are in the middle of writing a request, at which point we pause the
current write, force the state machine to completely receive the
reply, then resume where we left off writing the request.
Eric Blake (3):
commands: Preserve FIFO ordering
states: Split ISSUE_COMMAND.SEND_REQUES...
2019 Jun 14
0
[libnbd PATCH 5/7] states: Factor out NBD_REP payload prep
...State {
default_state with
- name = "SKIP_REPLY_PAYLOAD";
- comment = "Skip newstyle NBD_OPT_STARTTLS reply payload";
+ name = "RECV_REPLY_PAYLOAD";
+ comment = "Receive any newstyle NBD_OPT_STARTTLS reply payload";
external_events = [ NotifyRead, "" ];
};
@@ -425,8 +425,8 @@ and newstyle_opt_structured_reply_state_machine = [
State {
default_state with
- name = "SKIP_REPLY_PAYLOAD";
- comment = "Skip newstyle NBD_OPT_STRUCTURED_REPLY reply payload";
+ name = "RECV_REPLY_PAYLOAD"...
2019 Jun 05
2
Re: [PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
On 6/5/19 6:15 AM, Richard W.M. Jones wrote:
> Split h->state into:
>
> - h->state = the state on entry to the locked region
>
> - h->next_state = the current state and what the "publicly visible"
> state will become when we leave the locked region
The rest of this thread discusses potential other names, such as
h->public_state for the state visible
2019 Jun 18
0
[libnbd PATCH 1/8] states: Add state for structured reply completion
...diff --git a/generator/generator b/generator/generator
index a289741..4c81859 100755
--- a/generator/generator
+++ b/generator/generator
@@ -798,6 +798,13 @@ and structured_reply_state_machine = [
comment = "Receive a structured reply block-status payload";
external_events = [ NotifyRead, "" ];
};
+
+ State {
+ default_state with
+ name = "FINISH";
+ comment = "Finish receiving a structured reply";
+ external_events = [];
+ };
]
(*----------------------------------------------------------------------*)
diff --git a/generator/states-...
2020 Mar 30
4
[libnbd PATCH 0/2] fix hangs against nbdkit 1.2
nbdkit 1.2 as a server waits for read() to see EOF, even after the
client has sent NBD_CMD_DISC. That was fixed in mbdkit 1.4; and most
modern NBD servers are smarter than this (they close() the write end
of their traffic soon after NBD_CMD_DISC). But it's easy enough to
revert nbdkit commit c70616f8 to get back to a server with the same
behavior as the older nbdkit, at which point both
2020 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...comment = "Send newstyle NBD_OPT_LIST to being listing exports";
+ external_events = [ NotifyWrite, "" ];
+ };
+
+ State {
+ default_state with
+ name = "RECV_REPLY";
+ comment = "Receive newstyle NBD_OPT_LIST reply";
+ external_events = [ NotifyRead, "" ];
+ };
+
+ State {
+ default_state with
+ name = "RECV_REPLY_PAYLOAD";
+ comment = "Receive any newstyle NBD_OPT_LIST reply payload";
+ external_events = [ NotifyRead, "" ];
+ };
+
+ State {
+ default_state with
+ name = "CHECK...
2019 Sep 11
1
Re: [PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
...t; READY
libnbd: debug: nbd5: nbd_pread: poll start: events=1
nbdkit: debug: starting worker thread full.2
nbdkit: debug: starting worker thread full.5
nbdkit: full.0: debug: full: pread count=512 offset=0
libnbd: debug: nbd5: nbd_pread: poll end: r=1 revents=1
libnbd: debug: nbd5: nbd_pread: event NotifyRead: READY -> REPLY.START
nbdkit: libnbd: debug: nbd5: nbd_pread: transition: REPLY.START -> REPLY.RECV_REPLY
debug: libnbd: debug: nbd5: nbd_pread: transition: REPLY.RECV_REPLY -> REPLY.CHECK_SIMPLE_OR_STRUCTURED_REPLY
starting worker thread full.8libnbd: debug: nbd5: nbd_pread: transition: R...
2019 Sep 11
4
[PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
Very much a work in progress as there are still many tests using
qemu-io which are candidates for conversion.
You'll notice at the end of test-full.sh that the new test has some
duplicated code which looks as if it ought to be refactored into a
Python function. When I tried to do that, I got loads of strange
Python problems which may indicate bugs in nbdsh itself or problems
with my
2023 Aug 03
1
[libnbd PATCH v4 20/25] generator: Actually request extended headers
...wstyle NBD_OPT_EXTENDED_HEADERS negotiation request";
+ external_events = [ NotifyWrite, "" ];
+ };
+
+ State {
+ default_state with
+ name = "RECV_REPLY";
+ comment = "Receive newstyle NBD_OPT_EXTENDED_HEADERS option reply";
+ external_events = [ NotifyRead, "" ];
+ };
+
+ State {
+ default_state with
+ name = "RECV_REPLY_PAYLOAD";
+ comment = "Receive any newstyle NBD_OPT_EXTENDED_HEADERS reply payload";
+ external_events = [ NotifyRead, "" ];
+ };
+
+ State {
+ default_state with
+ name =...
2019 May 19
0
[libnbd PATCH 4/4] states: Add NBD_OPT_EXPORT_NAME handling
...comment = "Send newstyle NBD_OPT_EXPORT_NAME export name";
+ external_events = [ NotifyWrite, "" ];
+ };
+
+ State {
+ default_state with
+ name = "RECV_REPLY";
+ comment = "Receive newstyle NBD_OPT_EXPORT_NAME reply";
+ external_events = [ NotifyRead, "" ];
+ };
+
+ State {
+ default_state with
+ name = "CHECK_REPLY";
+ comment = "Check newstyle NBD_OPT_EXPORT_NAME reply";
+ external_events = [];
+ };
+]
+
(* Sending a command to the server. *)
and issue_command_state_machine = [
State {
diff --...
2019 Jun 14
10
[libnbd PATCH 0/7] state machine refactoring
I'm still playing with ideas on how to split rstate from wstate (so
that we can send a request without waiting for POLLIN to complete a
pending reply), but this is some preliminary refactoring I found
useful. I also fixed a couple of bugs while in the area (already
pushed).
There's a question of whether we want nbd_handle to be nearly 5k, or
if we should instead keep it small and add one
2019 Oct 18
0
[PATCH libnbd 2/2] api: Add support for AF_VSOCK.
...nect_socket", (1, 2);
+ "connect_vsock", (1, 2);
+ "aio_connect_vsock", (1, 2);
(* These calls are proposed for a future version of libnbd, but
* have not been added to any released version so far.
@@ -3151,7 +3196,7 @@ end = struct
let all_external_events =
[NotifyRead; NotifyWrite;
CmdCreate;
- CmdConnectSockAddr; CmdConnectUnix; CmdConnectTCP;
+ CmdConnectSockAddr; CmdConnectUnix; CmdConnectVSock; CmdConnectTCP;
CmdConnectCommand; CmdConnectSA; CmdConnectSocket;
CmdIssue]
@@ -3161,6 +3206,7 @@ let string_of_external_event = function
| CmdCr...
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.