search for: nbd_rep_serv

Displaying 20 results from an estimated 39 matches for "nbd_rep_serv".

Did you mean: nbd_rep_err
2019 Jun 28
0
[libnbd PATCH] opt-go: Better decoding of known errors
...nbd-protocol.h index 405af3e..3e3fb4e 100644 --- a/lib/nbd-protocol.h +++ b/lib/nbd-protocol.h @@ -123,15 +123,19 @@ struct nbd_fixed_new_option_reply { #define NBD_REP_ERR(val) (0x80000000 | (val)) #define NBD_REP_IS_ERR(val) (!!((val) & 0x80000000)) -#define NBD_REP_ACK 1 -#define NBD_REP_SERVER 2 -#define NBD_REP_INFO 3 -#define NBD_REP_META_CONTEXT 4 -#define NBD_REP_ERR_UNSUP NBD_REP_ERR (1) -#define NBD_REP_ERR_POLICY NBD_REP_ERR (2) -#define NBD_REP_ERR_INVALID NBD_REP_ERR (3) -#define NBD_REP_ERR_PLATFORM NBD_REP_ERR (4) -#define NBD_REP_ERR_TLS_REQD NBD_REP_ERR...
2020 Jul 21
0
Re: Extending nbdkit to support listing exports
...l to make it possible for NBD_OPT_LIST to support a hierarchical return. That is, pointing the file plugin to serve directory=base containing the following layout: base + f1 + dir1 + f2 + f3 + dir2 + f4 the current semantics of NBD_OPT_LIST only lend themselves to returning 4 NBD_REP_SERVER replies in a row: "f1", "dir1/f2", "dir1/f3", "dir2/f4". But what if the protocol added NBD_OPT_LIST_HIER which took a starting point argument, and new replies NBD_REP_SERVER_DIR and NBD_REP_ERR_NOTDIR, such that we could then have: NBD_OPT_LIST_HIER(&...
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.
2020 Jul 21
3
Extending nbdkit to support listing exports
Hi Eric, Nir. $SUBJECT - it's complicated! Imagine a scenario where we have extended the file plugin so you can point it at a directory and it will use the client-supplied export name to select a file to serve. Also we have extended the tar filter so that you can map tar file components into export names. You may be able to see where this is going ... Now we point the file plugin at a
2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
...option; /* option we are replying to */ uint32_t reply; /* NBD_REP_* */ @@ -110,33 +119,37 @@ struct fixed_new_option_reply { #define NBD_REP_ERR(val) (0x80000000 | (val)) #define NBD_REP_IS_ERR(val) (!!((val) & 0x80000000)) -#define NBD_REP_ACK 1 -#define NBD_REP_SERVER 2 -#define NBD_REP_INFO 3 -#define NBD_REP_META_CONTEXT 4 -#define NBD_REP_ERR_UNSUP NBD_REP_ERR (1) -#define NBD_REP_ERR_POLICY NBD_REP_ERR (2) -#define NBD_REP_ERR_INVALID NBD_REP_ERR (3) -#define NBD_REP_ERR_PLATFORM NBD_REP_ERR (4) -#define NBD_REP_ERR_TLS_REQD NBD_REP_ERR...
2020 Jul 22
3
[PATCH nbdkit v2] PROPOSED: server: Implement list_exports.
Updated proposal, taking into account the default export. Instead of adding a second call, I made a couple of changes to list_exports: (1) If the plugin has a concept of a default export, it should add it as the first element in the exports list. (2) There is a new default_only flag which tells the plugin that the client is trying to request the name of the default export, so the
2020 Jul 20
2
Re: [PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
....payload.server; > + uint32_t reply; > + uint32_t len; > + uint32_t elen; > + char *name; > + char **new_exports; > + > + reply = be32toh (h->sbuf.or.option_reply.reply); > + len = be32toh (h->sbuf.or.option_reply.replylen); > + switch (reply) { > + case NBD_REP_SERVER: > + /* Got one export. */ > + if (len > maxpayload) > + debug (h, "skipping too large export name reply"); > + else { > + elen = be32toh (h->sbuf.or.payload.server.server.export_name_len); > + if (elen > len - 4) { > + set_er...
2020 Jul 20
0
[PATCH libnbd PROPOSAL] Add APIs for listing exports from an NBD server.
...+ const size_t maxpayload = sizeof h->sbuf.or.payload.server; + uint32_t reply; + uint32_t len; + uint32_t elen; + char *name; + char **new_exports; + + reply = be32toh (h->sbuf.or.option_reply.reply); + len = be32toh (h->sbuf.or.option_reply.replylen); + switch (reply) { + case NBD_REP_SERVER: + /* Got one export. */ + if (len > maxpayload) + debug (h, "skipping too large export name reply"); + else { + elen = be32toh (h->sbuf.or.payload.server.server.export_name_len); + if (elen > len - 4) { + set_error (0, "invalid export length...
2018 Dec 06
0
[PATCH nbdkit 3/5] protocol: Generate map functions from NBD protocol flags to printable strings.
...; #define NBD_OPT_EXPORT_NAME 1 #define NBD_OPT_ABORT 2 #define NBD_OPT_LIST 3 @@ -101,6 +104,7 @@ struct fixed_new_option_reply { #define NBD_OPT_INFO 6 #define NBD_OPT_GO 7 +extern const char *name_of_nbd_rep (int); #define NBD_REP_ACK 1 #define NBD_REP_SERVER 2 #define NBD_REP_INFO 3 @@ -110,6 +114,7 @@ struct fixed_new_option_reply { #define NBD_REP_ERR_PLATFORM 0x80000004 #define NBD_REP_ERR_TLS_REQD 0x80000005 +extern const char *name_of_nbd_info (int); #define NBD_INFO_EXPORT 0 /* NBD_INFO_EXPORT reply (follows fixed_ne...
2019 Sep 01
11
[nbdkit PATCH 00/10] Avoid -Wshadow
While working on can_FOO caching, at one point I got confused by whether 'readonly' meant the global set by -r or a local passed to .open(). A quick attempt to compile with -Wshadow found several other confusing points; this series gets us to the point that we can add -Wshadow to builds with --enable-gcc-warnings. Eric Blake (10): server: Avoid -Wshadow warnings guestfs: Avoid
2018 Dec 06
10
[PATCH nbdkit 0/5] protocol: Generate map functions from NBD protocol flags to printable strings.
With some crufty sed scripts we can generate functions that map from NBD protocol flags (eg. NBD_CMD_READ) to strings ("NBD_CMD_READ"). This works on GNU sed and with FreeBSD, also with GNU sed's --posix option, so I guess the sed code is POSIX-compatible. Rich.
2018 Aug 06
0
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
...ags. */ #define NBD_FLAG_FIXED_NEWSTYLE 1 #define NBD_FLAG_NO_ZEROES 2 @@ -105,15 +98,35 @@ struct new_handshake_finish { #define NBD_OPT_ABORT 2 #define NBD_OPT_LIST 3 #define NBD_OPT_STARTTLS 5 +#define NBD_OPT_GO 7 #define NBD_REP_ACK 1 #define NBD_REP_SERVER 2 +#define NBD_REP_INFO 3 #define NBD_REP_ERR_UNSUP 0x80000001 #define NBD_REP_ERR_POLICY 0x80000002 #define NBD_REP_ERR_INVALID 0x80000003 #define NBD_REP_ERR_PLATFORM 0x80000004 #define NBD_REP_ERR_TLS_REQD 0x80000005 +#define NBD_INFO_EXPORT 0 + +/* NBD_INFO_EXP...
2019 Sep 24
0
[PATCH nbdkit 2/4] common/protocol: Remove protostrings.sed, use bash+sed instead.
...2 #define NBD_OPT_LIST 3 @@ -113,7 +110,6 @@ extern const char *name_of_nbd_opt (int); #define NBD_REP_ERR(val) (0x80000000 | (val)) #define NBD_REP_IS_ERR(val) (!!((val) & 0x80000000)) -extern const char *name_of_nbd_rep (int); #define NBD_REP_ACK 1 #define NBD_REP_SERVER 2 #define NBD_REP_INFO 3 @@ -124,7 +120,6 @@ extern const char *name_of_nbd_rep (int); #define NBD_REP_ERR_PLATFORM NBD_REP_ERR (4) #define NBD_REP_ERR_TLS_REQD NBD_REP_ERR (5) -extern const char *name_of_nbd_info (int); #define NBD_INFO_EXPORT 0 /* NBD_INFO_EXPORT rep...
2020 Jul 22
2
Re: [PATCH nbdkit] server: Deprecate the -e/--exportname parameter.
On 7/22/20 4:02 AM, Richard W.M. Jones wrote: >> The more I think about it, the more I disagree with disabling this. >> Or, put another way, I think that the _only_ time -e makes sense is >> _when_ you are using --run. Consider: >> >> nbdkit -U - -e foo info --run 'nbdsh -u $uri -c "print(h.pread(3, 0))"' >> nbdkit -U - -e bar info --run
2019 Sep 24
11
[PATCH nbdkit 0/4] common/protocol: Unify public <nbd-protocol.h>
We should have only one NBD protocol file. Let's make nbdkit's version the canonical one, and use it in libnbd. Rich.
2019 Mar 20
0
[PATCH nbdkit 3/8] server: Implement Block Status requests to read allocation status.
..." PACKAGE_NAME extern void crypto_init (bool tls_set_on_cli); diff --git a/server/protocol.h b/server/protocol.h index 06b917e..a7de2f0 100644 --- a/server/protocol.h +++ b/server/protocol.h @@ -112,6 +112,7 @@ extern const char *name_of_nbd_rep (int); #define NBD_REP_ACK 1 #define NBD_REP_SERVER 2 #define NBD_REP_INFO 3 +#define NBD_REP_META_CONTEXT 4 #define NBD_REP_ERR_UNSUP 0x80000001 #define NBD_REP_ERR_POLICY 0x80000002 #define NBD_REP_ERR_INVALID 0x80000003 @@ -128,6 +129,18 @@ struct fixed_new_option_reply_info_export { uint16_t eflags; /* p...
2018 Aug 04
3
[PATCH nbdkit] protocol: Implement NBD_OPT_GO.
This is only lightly tested (against just qemu NBD client), and the code might be structured a little better as the _negotiate_handshake_newstyle_options function has now grown to be huge. Anyway works for me. Rich.
2019 Mar 19
0
[PATCH nbdkit 3/9] server: Implement Block Status requests to read allocation status.
..." PACKAGE_NAME extern void crypto_init (bool tls_set_on_cli); diff --git a/server/protocol.h b/server/protocol.h index 4fe3c75..a7de2f0 100644 --- a/server/protocol.h +++ b/server/protocol.h @@ -112,6 +112,7 @@ extern const char *name_of_nbd_rep (int); #define NBD_REP_ACK 1 #define NBD_REP_SERVER 2 #define NBD_REP_INFO 3 +#define NBD_REP_META_CONTEXT 4 #define NBD_REP_ERR_UNSUP 0x80000001 #define NBD_REP_ERR_POLICY 0x80000002 #define NBD_REP_ERR_INVALID 0x80000003 @@ -128,6 +129,18 @@ struct fixed_new_option_reply_info_export { uint16_t eflags; /* p...
2020 Jul 29
3
[libnbd PATCH 0/2] Expose export description
...we can reuse a single connection for both grabbing the list and finally using NBD_OPT_GO), but this change was easier to whip together while still thinking about that. [1] https://www.redhat.com/archives/libguestfs/2020-July/msg00092.html Eric Blake (2): api: Get description alongside name from NBD_REP_SERVER info: Expose description in list mode lib/internal.h | 7 +++++- generator/API.ml | 21 ++++++++++++++++-- generator/states-newstyle-opt-list.c | 29 +++++++++++++++++-------- lib/handle.c | 32 ++++++++++++++++++++++++---- ex...
2020 Jul 24
4
[libnbd PATCH 0/3] Expose server block size constraints
Necessary when writing a client that wants to avoid unnecessary EINVAL errors from sending unaligned requests. At some point, we may want to add synchronous convenience API wrappers that do request splitting or read-modify-write to obey server constraints while still appearing to the library client as accepting any possible request. But such a wrapper should only be synchronous and not copied to