Displaying 20 results from an estimated 24 matches for "opt_set_meta_context".
2020 Sep 28
0
[libnbd PATCH 2/3] generator: Rename OPT_SET_META_CONTEXT states
...a/generator/state_machine.ml
+++ b/generator/state_machine.ml
@@ -283,7 +283,7 @@ and newstyle_state_machine = [
*)
Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine);
Group ("OPT_STRUCTURED_REPLY", newstyle_opt_structured_reply_state_machine);
- Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine);
+ Group ("OPT_META_CONTEXT", newstyle_opt_meta_context_state_machine);
Group ("OPT_GO", newstyle_opt_go_state_machine);
Group ("OPT_EXPORT_NAME", newstyle_opt_export_name_state_machine);
@@ -453,8 +453,8 @@ a...
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
...luding my proposed
patch addition of qemu-nbd -A to show qemu:allocation-depth)
- figure out if we can make 'nbdinfo --map' use the new API to
automatically select all contexts advertised by the server
Eric Blake (3):
api: Add get_nr_meta_contexts, 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 => s...
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 Jun 29
0
[libnbd PATCH 2/6] generator: Allow DEAD state actions to run
...STATE MACHINE */
diff --git a/generator/states-newstyle-opt-set-meta-context.c b/generator/states-newstyle-opt-set-meta-context.c
index a00a411..7904fe7 100644
--- a/generator/states-newstyle-opt-set-meta-context.c
+++ b/generator/states-newstyle-opt-set-meta-context.c
@@ -53,7 +53,7 @@
NEWSTYLE.OPT_SET_META_CONTEXT.SEND:
switch (send_from_wbuf (h)) {
- case -1: SET_NEXT_STATE (%.DEAD); return -1;
+ case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
h->sbuf.len = htobe32 (strlen (h->export_name));
h->wbuf = &h->sbuf.len;
@@ -65,7 +65,7 @@
NEWSTYLE.OPT_SET_META_CONTEXT.SEND...
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
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...- * Copyright (C) 2013-2019 Red Hat Inc.
+ * Copyright (C) 2013-2020 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -83,7 +83,10 @@ STATE_MACHINE {
}
/* Next option. */
- SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START);
+ if (h->opt_mode)
+ SET_NEXT_STATE (%.NEGOTIATING);
+ else
+ SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START);
return 0;
} /* END STATE MACHINE */
diff --git a/generator/states-newstyle.c b/generator/states-newstyle.c
index 573f724..e61f373 100644
--- a/generator/states-newsty...
2019 Sep 11
1
Re: [PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
...nsition: NEWSTYLE.OPT_STRUCTURED_REPLY.RECV_REPLY_PAYLOAD -> NEWSTYLE.OPT_STRUCTURED_REPLY.CHECK_REPLY
libnbd: debug: nbd5: nbd_connect_uri: negotiated structured replies on this connection
libnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.OPT_STRUCTURED_REPLY.CHECK_REPLY -> NEWSTYLE.OPT_SET_META_CONTEXT.START
libnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.OPT_SET_META_CONTEXT.START -> NEWSTYLE.OPT_GO.START
libnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.OPT_GO.START -> NEWSTYLE.OPT_GO.SEND
libnbd: debug: nbd5: nbd_connect_uri: transition: NEWSTYLE.OPT_GO.SEND -> NEW...
2019 Jun 14
0
[libnbd PATCH 5/7] states: Factor out NBD_REP payload prep
...diff --git a/generator/states-newstyle-opt-set-meta-context.c b/generator/states-newstyle-opt-set-meta-context.c
index feaa295..94120e2 100644
--- a/generator/states-newstyle-opt-set-meta-context.c
+++ b/generator/states-newstyle-opt-set-meta-context.c
@@ -139,21 +139,13 @@
return 0;
NEWSTYLE.OPT_SET_META_CONTEXT.RECV_REPLY:
- uint32_t len;
- const uint32_t maxpayload = sizeof h->sbuf.or.payload.context;
-
switch (recv_into_rbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return -1;
case 0:
- /* Read the following payload if it is short enough to fit in the
- * static buffer. If it's...
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
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...under the terms of the GNU Lesser General Public
> @@ -112,6 +112,25 @@ handle_reply_error (struct nbd_handle *h)
>
> STATE_MACHINE {
> NEWSTYLE.START:
> + if (h->opt_mode) {
> + switch (h->sbuf.option.option) {
> + case NBD_OPT_GO:
> + SET_NEXT_STATE (%OPT_SET_META_CONTEXT.START);
> + return 0;
> + case NBD_OPT_ABORT:
> + h->sbuf.option.version = htobe64 (NBD_NEW_VERSION);
> + h->sbuf.option.option = htobe32 (NBD_OPT_ABORT);
> + h->sbuf.option.optlen = htobe32 (0);
> + h->wbuf = &h->sbuf;
> + h-...
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...- * Copyright (C) 2013-2019 Red Hat Inc.
+ * Copyright (C) 2013-2020 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -84,7 +84,10 @@ STATE_MACHINE {
}
/* Next option. */
- SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START);
+ if (h->opt_mode)
+ SET_NEXT_STATE (%.NEGOTIATING);
+ else
+ SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START);
return 0;
} /* END STATE MACHINE */
diff --git a/generator/states-newstyle.c b/generator/states-newstyle.c
index 8da4617..6613f9f 100644
--- a/generator/states-newsty...
2019 Sep 17
0
[PATCH libnbd 2/2] api: New API for reading NBD protocol.
...c | 9 ++++++++
9 files changed, 75 insertions(+), 4 deletions(-)
diff --git a/generator/generator b/generator/generator
index 28248ed..21aae3b 100755
--- a/generator/generator
+++ b/generator/generator
@@ -357,6 +357,16 @@ and newstyle_state_machine = [
Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine);
Group ("OPT_GO", newstyle_opt_go_state_machine);
Group ("OPT_EXPORT_NAME", newstyle_opt_export_name_state_machine);
+
+ (* When option parsing has successfully finished negotiation
+ * it will jump to this state for f...
2023 Aug 03
1
[libnbd PATCH v4 20/25] generator: Actually request extended headers
...- a/generator/API.ml
+++ b/generator/API.ml
@@ -953,23 +953,24 @@ "set_request_meta_context", {
(all C<nbd_connect_*> calls when L<nbd_set_opt_mode(3)> is false,
or L<nbd_opt_go(3)> and L<nbd_opt_info(3)> when option mode is
enabled) will also try to issue NBD_OPT_SET_META_CONTEXT when
-the server supports structured replies and any contexts were
-registered by L<nbd_add_meta_context(3)>. The default setting
-is true; however the extra step of negotiating meta contexts is
-not always desirable: performing both info and go on the same
-export works without needing to r...
2019 May 19
0
[libnbd PATCH 4/4] states: Add NBD_OPT_EXPORT_NAME handling
...s.c \
diff --git a/generator/generator b/generator/generator
index 4d42185..60e4c55 100755
--- a/generator/generator
+++ b/generator/generator
@@ -327,6 +327,7 @@ and newstyle_state_machine = [
Group ("OPT_STRUCTURED_REPLY", newstyle_opt_structured_reply_state_machine);
Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine);
Group ("OPT_GO", newstyle_opt_go_state_machine);
+ Group ("OPT_EXPORT_NAME", newstyle_opt_export_name_state_machine);
]
(* Fixed newstyle NBD_OPT_STARTTLS option. *)
@@ -565,6 +566,44 @@ and newstyle_opt_go_state_machin...
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 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
2019 Sep 04
2
[libnbd PATCH] api: Add way to avoid structured replies
...yle-opt-structured-reply.c
index d932248..415f7e0 100644
--- a/generator/states-newstyle-opt-structured-reply.c
+++ b/generator/states-newstyle-opt-structured-reply.c
@@ -20,6 +20,11 @@
/* STATE MACHINE */ {
NEWSTYLE.OPT_STRUCTURED_REPLY.START:
+ if (!h->request_sr) {
+ SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START);
+ return 0;
+ }
+
h->sbuf.option.version = htobe64 (NBD_NEW_VERSION);
h->sbuf.option.option = htobe32 (NBD_OPT_STRUCTURED_REPLY);
h->sbuf.option.optlen = htobe32 (0);
diff --git a/lib/handle.c b/lib/handle.c
index f8cc83a..c23ef01 100644
--- a/lib/handle.c
+++ b/lib/ha...
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.
2019 Sep 17
3
[PATCH libnbd 1/2] api: Add new API to read whether TLS was negotiated.
When LIBNBD_TLS_ALLOW is used we don't have a way to find out if TLS
was really negotiated. This adds a flag and a way to read it back.
Unfortunately there is no test yet, because LIBNBD_TLS_ALLOW is not
tested -- it really should be but requires quite a complicated set of
tests because ideally we'd like to find out whether it falls back
correctly for all supported servers.
---
TODO
2020 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...and skip to the next state in the list if not.
*)
Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine);
+ Group ("OPT_LIST", newstyle_opt_list_state_machine);
Group ("OPT_STRUCTURED_REPLY", newstyle_opt_structured_reply_state_machine);
Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine);
Group ("OPT_GO", newstyle_opt_go_state_machine);
@@ -341,6 +342,44 @@ and newstyle_opt_starttls_state_machine = [
};
]
+(* Fixed newstyle NBD_OPT_LIST option. *)
+and newstyle_opt_list_state_machine = [
+ State {
+ default_...