search for: fixed_new_option_reply

Displaying 20 results from an estimated 54 matches for "fixed_new_option_reply".

2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
...ssage. */ +struct nbd_export_name_option_reply { + uint64_t exportsize; /* size of export */ + uint16_t eflags; /* per-export flags */ + char zeroes[124]; /* optional zeroes */ +} __attribute__((packed));; + /* Fixed newstyle handshake reply message. */ -struct fixed_new_option_reply { +struct nbd_fixed_new_option_reply { uint64_t magic; /* NBD_REP_MAGIC */ uint32_t 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)...
2019 Jun 07
4
[nbdkit PATCH v2 0/2] Reduce network overhead with MSG_MORE/corking
This time around, the numbers are indeed looking better than in v1; and I like the interface better. Eric Blake (2): server: Prefer send() over write() server: Group related transmission send()s server/internal.h | 7 +++- server/connections.c | 51 +++++++++++++++++++++++++--- server/crypto.c | 11 ++++--
2018 Aug 06
0
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
...d_newstyle_option_reply_exportname (struct connection *conn, return 0; } +static int +send_newstyle_option_reply_info_export (struct connection *conn, + uint32_t option, uint32_t reply, + uint16_t info) +{ + struct fixed_new_option_reply fixed_new_option_reply; + struct fixed_new_option_reply_info_export export; + + fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); + fixed_new_option_reply.option = htobe32 (option); + fixed_new_option_reply.reply = htobe32 (reply); + fixed_new_option_reply.replylen = htobe32 (sizeof expo...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...p;handshake, sizeof handshake) == -1) { - nbdkit_error ("write: %m"); - return -1; - } - - return 0; -} - -/* Receive newstyle options. */ - -static int -send_newstyle_option_reply (struct connection *conn, - uint32_t option, uint32_t reply) -{ - struct fixed_new_option_reply fixed_new_option_reply; - - fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); - fixed_new_option_reply.option = htobe32 (option); - fixed_new_option_reply.reply = htobe32 (reply); - fixed_new_option_reply.replylen = htobe32 (0); - - if (conn->send (conn, - &fixed_...
2019 Jun 07
0
[nbdkit PATCH v2 2/2] server: Group related transmission send()s
...style.c b/server/protocol-handshake-newstyle.c index 6993c8e..e0136de 100644 --- a/server/protocol-handshake-newstyle.c +++ b/server/protocol-handshake-newstyle.c @@ -94,13 +94,13 @@ send_newstyle_option_reply_exportname (struct connection *conn, if (conn->send (conn, &fixed_new_option_reply, - sizeof fixed_new_option_reply, 0) == -1) { + sizeof fixed_new_option_reply, SEND_MORE) == -1) { nbdkit_error ("write: %s: %m", name_of_nbd_opt (option)); return -1; } len = htobe32 (name_len); - if (conn->send (conn, &len, size...
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status implementation. While the patches (especially the second one) are very large they are really just elementary code motion. Rich.
2019 Mar 20
0
[PATCH nbdkit 3/8] server: Implement Block Status requests to read allocation status.
...me_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; /* per-export flags */ } __attribute__((packed)); +/* NBD_REP_META_CONTEXT reply (follows fixed_new_option_reply). */ +struct fixed_new_option_reply_meta_context { + uint32_t context_id; /* metadata context ID */ + /* followed by a string...
2020 Sep 21
0
[nbdkit PATCH v3 03/14] server: Respond to NBD_INFO_NAME request
...} +/* Can be used for NBD_INFO_NAME and NBD_INFO_DESCRIPTION. */ +static int +send_newstyle_option_reply_info_str (uint32_t option, uint32_t reply, + uint16_t info, const char *str, + size_t len) +{ + GET_CONN; + struct nbd_fixed_new_option_reply fixed_new_option_reply; + struct nbd_fixed_new_option_reply_info_name_or_desc name; + + if (len == -1) + len = strlen (str); + assert (len <= NBD_MAX_STRING); + + fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); + fixed_new_option_reply.option = htobe32 (option); + fixed_new_opti...
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.
2018 Aug 06
3
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
There's no substantial difference over v1, I simply fixed a few whitespace issues, moved one struct around and tidied up the comments. Rich.
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 19
0
[PATCH nbdkit 3/9] server: Implement Block Status requests to read allocation status.
...me_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; /* per-export flags */ } __attribute__((packed)); +/* NBD_REP_META_CONTEXT reply (follows fixed_new_option_reply). */ +struct fixed_new_option_reply_meta_context { + uint32_t context_id; /* metadata context ID */ + /* followed by a string...
2018 Dec 06
0
[PATCH nbdkit 3/5] protocol: Generate map functions from NBD protocol flags to printable strings.
...file.am | 17 +++++++++++-- src/protostrings.sed | 59 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 2 deletions(-) diff --git a/src/protocol.h b/src/protocol.h index 0444641..6709ddc 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -81,10 +81,12 @@ struct fixed_new_option_reply { #define NBD_REP_MAGIC UINT64_C(0x3e889045565a9) /* Global flags. */ +extern const char *name_of_nbd_global_flag (int); #define NBD_FLAG_FIXED_NEWSTYLE 1 #define NBD_FLAG_NO_ZEROES 2 /* Per-export flags. */ +extern const char *name_of_nbd_flag (int); #define NBD_FLAG_HAS_FLAGS...
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far. Rich.
2020 Jul 31
6
[RFC nbdkit PATCH 0/4] Progress towards .list_exports
This takes Rich's API proposal and starts fleshing it out with enough meat that I was able to test 'nbdkit eval' advertising multiple exports with descriptions paired with 'qemu-nbd --list'. Eric Blake (3): server: Add exports list functions server: Prepare to use export list from plugin sh, eval: Add .list_exports support Richard W.M. Jones (1): server: Implement
2019 Aug 30
0
[nbdkit PATCH 5/9] server: Cache per-connection size
..., static int send_newstyle_option_reply_info_export (struct connection *conn, uint32_t option, uint32_t reply, - uint16_t info) + uint16_t info, uint64_t exportsize) { struct fixed_new_option_reply fixed_new_option_reply; struct fixed_new_option_reply_info_export export; @@ -127,7 +127,7 @@ send_newstyle_option_reply_info_export (struct connection *conn, fixed_new_option_reply.reply = htobe32 (reply); fixed_new_option_reply.replylen = htobe32 (sizeof export); export.info = htobe16...
2020 Aug 06
6
[nbdkit PATCH v2 0/5] .list_exports
Since v1: - patch 1: check size limits - patch 2: better handling of default export name canonicalization - patch 3: support filters as well as plugins - patch 4: new - patch 5: rewrite sh parser, fix testsuite to actually work and cover more cases (now that libnbd.git is fixed) Eric Blake (4): server: Add exports list functions server: Prepare to use export list from plugin log: Add
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...@@ -49,9 +49,9 @@ /* Receive newstyle options. */ static int -send_newstyle_option_reply (struct connection *conn, - uint32_t option, uint32_t reply) +send_newstyle_option_reply (uint32_t option, uint32_t reply) { + struct connection *conn = GET_CONN; struct nbd_fixed_new_option_reply fixed_new_option_reply; fixed_new_option_reply.magic = htobe64 (NBD_REP_MAGIC); @@ -59,8 +59,7 @@ send_newstyle_option_reply (struct connection *conn, fixed_new_option_reply.reply = htobe32 (reply); fixed_new_option_reply.replylen = htobe32 (0); - if (conn->send (conn, -...
2020 Feb 11
4
[PATCH nbdkit v2 0/3] server: Remove explicit connection parameter.
v1 was here: https://www.redhat.com/archives/libguestfs/2020-February/msg00081.html v2 replaces struct connection *conn = GET_CONN; with GET_CONN; which sets conn implicitly and asserts that it is non-NULL. If we actually want to test if conn is non-NULL or behave differently, then you must use threadlocal_get_conn() instead, and some existing uses do that. Rich.
2020 Feb 11
5
[PATCH nbdkit 0/3] server: Remove explicit connection parameter.
The third patch is a large but mechanical change which gets rid of passing around struct connection * entirely within the server, preferring instead to reference the connection through thread-local storage. I hope this is a gateway to simplifying other parts of the code. Rich.