Displaying 19 results from an estimated 19 matches for "request_meta_context".
Did you mean:
request_meta_contexts
2020 Oct 27
6
[PATCH libnbd 0/5] info: --map: Coalesce adjacent extents of the same type.
This adds coalescing of adjacent extents of the same type, as
mentioned by Eric Blake in the commit message here:
https://github.com/libguestfs/libnbd/commit/46072f6611f80245846a445766da071e457b00cd
The patch series is rather long because it detours through adding the
<vector.h> library from nbdkit into libnbd and replacing ad hoc uses
of realloc, char ** etc in various places.
Rich.
2020 Sep 28
8
[libnbd PATCH 0/3] opt_list_meta_context
I'm posting this now, as I'm at the end of a workday and I got things
working for manual experimentation.
Still to do:
- write interop tests for qemu-nbd and nbdkit (including 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
2020 Sep 28
0
[libnbd PATCH 1/3] api: Add get_nr_meta_contexts, clear_meta_contexts
...andle.c
index a6b2172..e0047b7 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@@ -313,6 +313,38 @@ nbd_unlocked_add_meta_context (struct nbd_handle *h, const char *name)
return 0;
}
+int
+nbd_unlocked_get_nr_meta_contexts (struct nbd_handle *h)
+{
+ return nbd_internal_string_list_length (h->request_meta_contexts);
+}
+
+char *
+nbd_unlocked_get_meta_context (struct nbd_handle *h, int i)
+{
+ size_t len = nbd_internal_string_list_length (h->request_meta_contexts);
+ char *ret;
+
+ if (i < 0 || i >= len) {
+ set_error (EINVAL, "meta context request out of range");
+ return NULL;...
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...;t request any metadata
- * contexts.
+ * contexts, when doing SET (but an empty LIST is okay).
*/
assert (h->gflags & LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE);
nbd_internal_reset_size_and_flags (h);
- if (!h->structured_replies ||
- nbd_internal_string_list_length (h->request_meta_contexts) == 0) {
- SET_NEXT_STATE (%^OPT_GO.START);
- return 0;
+ if (h->opt_current == NBD_OPT_LIST_META_CONTEXT) {
+ assert (h->opt_mode);
+ assert (h->structured_replies);
+ assert (CALLBACK_IS_NOT_NULL (h->opt_cb.fn.context));
+ opt = h->opt_current;
+ }
+ else {
+...
2020 Sep 28
0
[libnbd PATCH 2/3] generator: Rename OPT_SET_META_CONTEXT states
...TA_CONTEXT.SEND_NRQUERIES:
switch (send_from_wbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
@@ -97,7 +97,7 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.PREPARE_NEXT_QUERY:
+ NEWSTYLE.OPT_META_CONTEXT.PREPARE_NEXT_QUERY:
const char *query = h->request_meta_contexts[h->querynum];
if (query == NULL) { /* end of list of requested meta contexts */
@@ -112,7 +112,7 @@ STATE_MACHINE {
SET_NEXT_STATE (%SEND_QUERYLEN);
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.SEND_QUERYLEN:
+ NEWSTYLE.OPT_META_CONTEXT.SEND_QUERYLEN:
const char *query = h->reques...
2020 Oct 02
4
[libnbd PATCH v2 0/2] opt_list_meta_context
In v2: ack'ed preliminary patches have been pushed, and I've added a
lot of testsuite coverage as well as putting the new API to use in
nbdinfo.
Eric Blake (2):
api: Add nbd_opt_list_meta_context
info: List available meta-contexts
lib/internal.h | 1 +
generator/API.ml | 84 ++++++++-
2020 Sep 29
0
[PATCH libnbd] DO NOT PUSH: Update api: Add get_nr_meta_contexts, clear_meta_contexts
...dle.c
+++ b/lib/handle.c
@@ -320,12 +320,12 @@ nbd_unlocked_get_nr_meta_contexts (struct nbd_handle *h)
}
char *
-nbd_unlocked_get_meta_context (struct nbd_handle *h, int i)
+nbd_unlocked_get_meta_context (struct nbd_handle *h, size_t i)
{
size_t len = nbd_internal_string_list_length (h->request_meta_contexts);
char *ret;
- if (i < 0 || i >= len) {
+ if (i >= len) {
set_error (EINVAL, "meta context request out of range");
return NULL;
}
--
2.28.0.rc2
2019 May 23
2
Re: [PATCH libnbd v2 1/6] api: Synchronous connect waits til all connections are connected.
..._conn and
nbd_get_multi_conn that things were changed because multi_conn was not
supported after all.
Or maybe we want both 'set_multi_conn' (connect hard-fails if the FIRST
connection reports !can_multi_conn) vs. 'request_multi_conn' (connect
downgrades gracefully), similar to how request_meta_context downgrades
gracefully if the server lacks SR or a particular meta context.
On IRC we were chatting about how multi-conn > 1 makes no sense with
connect_command() (where we are limited to exactly one channel over
stdin/stdout), so it may also be worth adding some logic to have
connect_command fa...
2019 Jun 08
0
[PATCH libnbd 3/3] states: Use MSG_MORE to coalesce messages into single packets.
...AMELEN);
}
return 0;
@@ -67,6 +69,7 @@
case 0:
h->wbuf = h->export_name;
h->wlen = strlen (h->export_name);
+ h->wflags = MSG_MORE;
SET_NEXT_STATE (%SEND_EXPORTNAME);
}
return 0;
@@ -79,6 +82,7 @@
htobe32 (nbd_internal_string_list_length (h->request_meta_contexts));
h->wbuf = &h->sbuf;
h->wlen = sizeof h->sbuf.nrqueries;
+ h->wflags = MSG_MORE;
SET_NEXT_STATE (%SEND_NRQUERIES);
}
return 0;
@@ -103,6 +107,7 @@
h->sbuf.len = htobe32 (strlen (query));
h->wbuf = &h->sbuf.len;
h->wlen = sizeof...
2019 Oct 20
0
[PATCH libnbd] api: Allow NBD URIs to be restricted.
...uri_allow_local_file (struct nbd_handle *h, bool allow)
+{
+ h->uri_allow_local_file = allow;
+ return 0;
+}
diff --git a/lib/internal.h b/lib/internal.h
index 435cd36..50c0a9b 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -76,6 +76,11 @@ struct nbd_handle {
bool request_sr;
char **request_meta_contexts;
+ /* Allowed in URIs, see lib/uri.c. */
+ uint32_t uri_allow_transports;
+ int uri_allow_tls;
+ bool uri_allow_local_file;
+
/* Global flags from the server. */
uint16_t gflags;
diff --git a/lib/uri.c b/lib/uri.c
index b3dfe7d..704641c 100644
--- a/lib/uri.c
+++ b/lib/uri.c
@@ -216,...
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 Sep 04
2
[libnbd PATCH] api: Add way to avoid structured replies
...letion(-)
diff --git a/lib/internal.h b/lib/internal.h
index 581777a..a48edff 100644
--- a/lib/internal.h
+++ b/lib/internal.h
@@ -73,6 +73,7 @@ struct nbd_handle {
char *tls_psk_file; /* PSK filename, NULL = no PSK */
/* Desired metadata contexts. */
+ bool request_sr;
char **request_meta_contexts;
/* Global flags from the server. */
diff --git a/generator/generator b/generator/generator
index 1cc5c19..5c32afa 100755
--- a/generator/generator
+++ b/generator/generator
@@ -1243,6 +1243,36 @@ Get the current TLS PSK filename.";
};
*)
+ "set_request_structured_replies"...
2019 Jun 29
0
[libnbd PATCH 2/6] generator: Allow DEAD state actions to run
...rt_name);
@@ -76,7 +76,7 @@
NEWSTYLE.OPT_SET_META_CONTEXT.SEND_EXPORTNAME:
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.nrqueries =
htobe32 (nbd_internal_string_list_length (h->request_meta_contexts));
@@ -89,7 +89,7 @@
NEWSTYLE.OPT_SET_META_CONTEXT.SEND_NRQUERIES:
switch (send_from_wbuf (h)) {
- case -1: SET_NEXT_STATE (%.DEAD); return -1;
+ case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
h->querynum = 0;
SET_NEXT_STATE (%PREPARE_NEXT_QUERY);
@@ -115,7 +115,7 @@...
2019 Oct 20
2
[PATCH libnbd] api: Allow NBD URIs to be restricted.
Previous discussion:
https://www.redhat.com/archives/libguestfs/2019-August/msg00102.html
Last night I experimentally added support for URIs that contain the
query parameter tls-psk-file, as part of rewriting the tests to cover
more of the URI code. So you can now have a URI like:
nbds://alice@localhost/?tls-psk-file=keys.psk
However there's an obvious security problem here because now
2019 Jun 08
6
[PATCH libnbd 0/3] states: Use MSG_MORE to coalesce messages.
Appears to have a measurable benefit, see 3/3 for test results.
Rich.
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 May 22
8
[PATCH libnbd v2 0/6] Test connection states.
Patch 1/6 was posted before and I didn't change it:
https://www.redhat.com/archives/libguestfs/2019-May/thread.html#00134
That doesn't necessarily mean I shouldn't change it, I'm posting
it again because the other patches depend on it.
The main change in this series is we add three new API functions:
nbd_aio_is_created - connection has just been created
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
Well, I'm not quite done (I still want to get nbdinfo to work on a
single nbd connection for all cases when reading the heads of the
file is not required), but I'm happy with patches 1-11, and 12-13
show where I'm headed for getting NBD_OPT_INFO to work. Posting
now to see if some of the earlier patches are ready to commit while
I continue working on the latter half.
Eric Blake (13):
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