search for: check_simple_or_structured_reply

Displaying 10 results from an estimated 10 matches for "check_simple_or_structured_reply".

2023 Jun 09
4
[libnbd PATCH v4 0/4] Saner reply header layout
This was v3 patch 2/22, reworked to address the confusion about how a structured reply header is read in two pieces before getting to the payload portion. I'm still working on rebasing the rest of my v3 series (patches 1, 3-22) from other comments given, but this seemed independent enough that it's worth posting now rather than holding it up for the rest of the series. Eric Blake (4):
2019 Sep 11
1
Re: [PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
...=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: REPLY.CHECK_SIMPLE_OR_STRUCTURED_REPLY -> REPLY.STRUCTURED_REPLY.START libnbd: debug: nbd5: nbd_pread: transition: REPLY.STRUCTURED_REPLY.START -> REPLY.STRUCTURED_REPLY.RECV_REMAINING libnbd: debug: nbd5: nbd_pread: tr...
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
2019 Jun 18
0
[libnbd PATCH 2/8] states: Consolidate search for current reply's command
...;sbuf; h->rlen = sizeof h->sbuf.simple_reply; + assert (h->reply_cmd == NULL); + r = h->sock->ops->recv (h, h->sock, h->rbuf, h->rlen); if (r == -1) { /* This should never happen because when we enter this state we @@ -69,16 +71,16 @@ return 0; REPLY.CHECK_SIMPLE_OR_STRUCTURED_REPLY: + struct command_in_flight *cmd; uint32_t magic; + uint64_t handle; magic = be32toh (h->sbuf.simple_reply.magic); if (magic == NBD_SIMPLE_REPLY_MAGIC) { SET_NEXT_STATE (%SIMPLE_REPLY.START); - return 0; } else if (magic == NBD_STRUCTURED_REPLY_MAGIC) { SET_NEXT_ST...
2019 Jun 25
0
Re: [libnbd PATCH] states: Never block state machine inside REPLY
...gt; * Reading a zero length now would indicate that the socket has been > @@ -66,6 +99,7 @@ > REPLY.RECV_REPLY: > switch (recv_into_rbuf (h)) { > case -1: SET_NEXT_STATE (%.DEAD); return -1; > + case 1: SET_NEXT_STATE (%.READY); return 0; > case 0: SET_NEXT_STATE (%CHECK_SIMPLE_OR_STRUCTURED_REPLY); > } > return 0; > diff --git a/lib/internal.h b/lib/internal.h > index a1e27df..662ff7a 100644 > --- a/lib/internal.h > +++ b/lib/internal.h > @@ -253,6 +253,7 @@ struct command_in_flight { > uint32_t count; > void *data; /* Buffer for read/write */ >...
2019 Jun 19
4
[libnbd PATCH] states: Never block state machine inside REPLY
...know the socket is readable here. * Reading a zero length now would indicate that the socket has been @@ -66,6 +99,7 @@ REPLY.RECV_REPLY: switch (recv_into_rbuf (h)) { case -1: SET_NEXT_STATE (%.DEAD); return -1; + case 1: SET_NEXT_STATE (%.READY); return 0; case 0: SET_NEXT_STATE (%CHECK_SIMPLE_OR_STRUCTURED_REPLY); } return 0; diff --git a/lib/internal.h b/lib/internal.h index a1e27df..662ff7a 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -253,6 +253,7 @@ struct command_in_flight { uint32_t count; void *data; /* Buffer for read/write */ struct command_cb cb; + enum state state; /* Stat...
2019 Jun 29
0
[libnbd PATCH 2/6] generator: Allow DEAD state actions to run
...STATE (%.CLOSED); @@ -99,7 +99,7 @@ save_reply_state (struct nbd_handle *h) REPLY.RECV_REPLY: switch (recv_into_rbuf (h)) { - case -1: SET_NEXT_STATE (%.DEAD); return -1; + case -1: SET_NEXT_STATE (%.DEAD); return 0; case 1: SET_NEXT_STATE (%.READY); return 0; case 0: SET_NEXT_STATE (%CHECK_SIMPLE_OR_STRUCTURED_REPLY); } @@ -120,7 +120,7 @@ save_reply_state (struct nbd_handle *h) else { SET_NEXT_STATE (%.DEAD); /* We've probably lost synchronization. */ set_error (0, "invalid reply magic"); - return -1; + return 0; } /* NB: This works for both simple and structured rep...
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 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 29
19
[libnbd PATCH 0/6] new APIs: aio_in_flight, aio_FOO_notify
I still need to wire in the use of *_notify functions into nbdkit to prove whether it makes the code any faster or easier to maintain, but at least the added example shows one good use case for the new API. Eric Blake (6): api: Add nbd_aio_in_flight generator: Allow DEAD state actions to run generator: Allow Int64 in callbacks states: Prepare for aio notify callback api: Add new