search for: nbd_get_protocol

Displaying 13 results from an estimated 13 matches for "nbd_get_protocol".

2019 Sep 17
1
[libnbd PATCH] api: Add nbd_get_structured_replies_negotiated
...desc = "\ +After connecting you may call this to find out if the connection is +using structured replies."; + see_also = ["L<nbd_set_request_structured_replies(3)>"; + "L<nbd_get_request_structured_replies(3)>"; + "L<nbd_get_protocol(3)>"]; }; "set_handshake_flags", { @@ -1673,7 +1690,9 @@ be returned in the future. Most modern NBD servers use C<\"newstyle-fixed\">. " ^ non_blocking_test_call_description; - see_also = ["L<nbd_get_handshake_flags(3)>"]; + see...
2019 Sep 17
0
[PATCH libnbd 2/2] api: New API for reading NBD protocol.
..."null", "size=" STR(SIZE), NULL }; + const char *s; nbd = nbd_create (); if (nbd == NULL) { @@ -51,6 +54,14 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } + /* Even ancient versions of nbdkit only supported newstyle-fixed. */ + s = nbd_get_protocol (nbd); + if (strcmp (s, "newstyle-fixed") != 0) { + fprintf (stderr, + "incorrect protocol \"%s\", expected \"newstyle-fixed\"\n", s); + exit (EXIT_FAILURE); + } + if ((r = nbd_get_size (nbd)) == -1) { fprintf (stderr, "%s\n&q...
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
2019 Sep 17
1
Re: [PATCH libnbd 2/2] api: New API for reading NBD protocol.
...hit then it indicates a bug in libnbd. > + */ > + assert (h->protocol); Sounds correct to me. > @@ -51,6 +54,14 @@ main (int argc, char *argv[]) > exit (EXIT_FAILURE); > } > > + /* Even ancient versions of nbdkit only supported newstyle-fixed. */ > + s = nbd_get_protocol (nbd); > + if (strcmp (s, "newstyle-fixed") != 0) { > + fprintf (stderr, > + "incorrect protocol \"%s\", expected \"newstyle-fixed\"\n", s); > + exit (EXIT_FAILURE); > + } With nbdkit 1.16 --mask-handshake and/or my patch f...
2020 Sep 26
1
[PATCH nbdinfo proposal] info: Add a --map option for displaying allocation metadata
This is a rough-and-ready implementation of nbdinfo --map option, to display the allocation and other metadata of NBD exports. I only tested it lightly against nbdkit. It needs at least some tests. Command like these should work: nbdinfo --map nbd://localhost nbdinfo --map=qemu:dirty-bitmap nbd://localhost Rich.
2019 Nov 14
1
ANNOUNCE: libnbd 1.2 & nbdkit 1.16 - high performance NBD client and server
...ndshake_flags(3) nbd_set_handshake_flags(3) nbd_get_request_structured_replies(3) nbd_set_request_structured_replies(3) nbd_get_structured_replies_negotiated(3) Can be used when testing NBD servers to avoid various NBD features (Eric Blake). nbd_get_protocol(3) Get the NBD protocol variant that the server supports. nbd_get_tls_negotiated(3) Did we actually negotiate a TLS connection? nbd_set_uri_allow_local_file(3) nbd_set_uri_allow_tls(3) nbd_set_uri_allow_transports(3) These can be used t...
2020 Sep 26
0
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
...t;= prev_offset) { + fprintf (stderr, "%s: --map: server did not return any extents\n", + argv[0]); + exit (EXIT_FAILURE); + } + } + if (json_output) printf ("\n]\n"); + } else { /* Print per-connection fields. */ protocol = nbd_get_protocol (nbd); @@ -591,3 +646,70 @@ get_content (struct nbd_handle *nbd, int64_t size) free (cmd); return ret; /* caller frees */ } + +/* Callback handling --map. */ +static const char * +extent_description (const char *metacontext, uint32_t type) +{ + if (strcmp (metacontext, &qu...
2020 Aug 03
5
[libnbd PATCH 0/4] More nbdinfo fixes
This rounds up the remaining bugs that I originally identified in: https://www.redhat.com/archives/libguestfs/2020-July/msg00153.html Eric Blake (4): api: Permit export list APIs when Connected info: Support --list with serializing servers info: Fix --json output when list size != 1 info: Permit --size --json generator/API.ml | 6 +++--- info/info-list-json.sh | 9 +++++++++
2020 Aug 11
3
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
On 8/11/20 12:12 PM, Richard W.M. Jones wrote: > I think this needs extra documentation in docs/libnbd.pod because it's > definitely not clear just from the rather thin manual page for > set_opt_mode how it works. docs/libnbd.pod is a good place for a > broader description of how it works. Yes, good idea. State-wise, the existing flow was: Created - Progress only by command
2020 Sep 26
2
[PATCH nbdinfo v2] info: Add a --map option for displaying allocation metadata.
Fixes bugs with JSON output in the previous patch, and adds some tests. Rich.
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...+ exit (EXIT_FAILURE); + } + + /* Protocol should be "newstyle-fixed", with structured replies already + * negotiated. + */ + if (nbd_aio_is_negotiating (nbd) != true) { + fprintf (stderr, "unexpected state after connection\n"); + exit (EXIT_FAILURE); + } + s = nbd_get_protocol (nbd); + if (strcmp (s, "newstyle-fixed") != 0) { + fprintf (stderr, + "incorrect protocol \"%s\", expected \"newstyle-fixed\"\n", s); + exit (EXIT_FAILURE); + } + if ((r = nbd_get_structured_replies_negotiated (nbd)) != 1) { + fprintf...
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):
2020 Aug 18
3
[libnbd PATCH v3 0/2] Implementing NBD_OPT_LIST
This is a subset of my v2 posting, but limited to just the NBD_OPT_LIST handling. The biggest change since v2 is the addition of added unit testing in all four language bindings (C, python, ocaml, golang). The tests require nbdkit built from git on PATH, and may not be entirely idiomatic, but I at least validated that they catch issues (for example, adding an exit statement near the end of the