Displaying 10 results from an estimated 10 matches for "recv_read_payload".
2019 Jun 18
0
[libnbd PATCH 3/8] pread: Reject server SR read response with no data chunks
...e0..935f6d2 100644
--- a/generator/states-reply-simple.c
+++ b/generator/states-reply-simple.c
@@ -40,6 +40,7 @@
if (cmd->error == 0 && cmd->type == NBD_CMD_READ) {
h->rbuf = cmd->data;
h->rlen = cmd->count;
+ cmd->data_seen = true;
SET_NEXT_STATE (%RECV_READ_PAYLOAD);
}
else {
diff --git a/generator/states-reply-structured.c b/generator/states-reply-structured.c
index 9bb165b..6740400 100644
--- a/generator/states-reply-structured.c
+++ b/generator/states-reply-structured.c
@@ -269,6 +269,7 @@
return -1;
}
assert (cmd->data);
+ cmd...
2019 Jun 18
0
[libnbd PATCH 5/8] states: Wire in a read callback
...----------------------------------------------------------*)
diff --git a/generator/states-reply-simple.c b/generator/states-reply-simple.c
index 935f6d2..ddc91ce 100644
--- a/generator/states-reply-simple.c
+++ b/generator/states-reply-simple.c
@@ -49,9 +49,22 @@
return 0;
REPLY.SIMPLE_REPLY.RECV_READ_PAYLOAD:
+ struct command_in_flight *cmd = h->reply_cmd;
+
switch (recv_into_rbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return -1;
- case 0: SET_NEXT_STATE (%^FINISH_COMMAND);
+ case 0:
+ /* guaranteed by START */
+ assert (cmd);
+ if (cmd->cb.fn.read) {
+ assert (cmd->e...
2019 Jun 21
0
[libnbd PATCH v2 2/5] states: Wire in a read callback
...----------------------------------------------------------*)
diff --git a/generator/states-reply-simple.c b/generator/states-reply-simple.c
index 935f6d2..87622a0 100644
--- a/generator/states-reply-simple.c
+++ b/generator/states-reply-simple.c
@@ -49,9 +49,22 @@
return 0;
REPLY.SIMPLE_REPLY.RECV_READ_PAYLOAD:
+ struct command_in_flight *cmd = h->reply_cmd;
+
switch (recv_into_rbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return -1;
- case 0: SET_NEXT_STATE (%^FINISH_COMMAND);
+ case 0:
+ /* guaranteed by START */
+ assert (cmd);
+ if (cmd->cb.fn.read) {
+ assert (cmd->e...
2019 Jun 20
1
Re: [libnbd PATCH 3/8] pread: Reject server SR read response with no data chunks
...states-reply-simple.c
> +++ b/generator/states-reply-simple.c
> @@ -40,6 +40,7 @@
> if (cmd->error == 0 && cmd->type == NBD_CMD_READ) {
> h->rbuf = cmd->data;
> h->rlen = cmd->count;
> + cmd->data_seen = true;
> SET_NEXT_STATE (%RECV_READ_PAYLOAD);
> }
> else {
> diff --git a/generator/states-reply-structured.c b/generator/states-reply-structured.c
> index 9bb165b..6740400 100644
> --- a/generator/states-reply-structured.c
> +++ b/generator/states-reply-structured.c
> @@ -269,6 +269,7 @@
> return -1;
>...
2019 Jun 25
0
Re: [libnbd PATCH] states: Never block state machine inside REPLY
...comment = "Receive a reply from the remote server";
> - external_events = [ NotifyRead, "" ];
> + external_events = [];
> };
>
> State {
> @@ -723,7 +723,7 @@ and simple_reply_state_machine = [
> default_state with
> name = "RECV_READ_PAYLOAD";
> comment = "Receiving the read payload for a simple reply";
> - external_events = [ NotifyRead, "" ];
> + external_events = [];
> };
> ]
>
> @@ -740,7 +740,7 @@ and structured_reply_state_machine = [
> default_state with
>...
2019 Jun 19
4
[libnbd PATCH] states: Never block state machine inside REPLY
...h
name = "RECV_REPLY";
comment = "Receive a reply from the remote server";
- external_events = [ NotifyRead, "" ];
+ external_events = [];
};
State {
@@ -723,7 +723,7 @@ and simple_reply_state_machine = [
default_state with
name = "RECV_READ_PAYLOAD";
comment = "Receiving the read payload for a simple reply";
- external_events = [ NotifyRead, "" ];
+ external_events = [];
};
]
@@ -740,7 +740,7 @@ and structured_reply_state_machine = [
default_state with
name = "RECV_REMAINING";...
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding
NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished
enough of an implementation to feel confident in posting it.
I'd still like to add something under examples/ that uses the new API
to implement strict checking of a server's structured replies read
implementation (ensure that a server never sends data after
2019 Jun 21
9
[libnbd PATCH v2 0/5] nbd_pread_structured
Since v1:
- rebase to applied patches
- split out support for Int in callbacks
- sort of test that callbacks work in OCaml (see comment in patch 5)
- rename API to nbd_pread_structured
- expose error as explicit parameter to callback
Eric Blake (5):
generator: Allow Int in callbacks
states: Wire in a read callback
states: Add nbd_pread_structured API
states: Add tests for
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
2019 Jun 04
9
[PATCH libnbd v2 0/4] api: Implement concurrent writer.
v1:
https://www.redhat.com/archives/libguestfs/2019-June/msg00014.html
I pushed a few bits which are uncontroversial. The main
changes since v1 are:
An extra patch removes the want_to_send / check for nbd_aio_is_ready
in examples/threaded-reads-and-writes.c. This logic was wrong since
commit 6af72b87 as was pointed out by Eric in his review. Comments
and structure of