Displaying 20 results from an estimated 51 matches for "nbd_info_export".
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.
2018 Aug 06
0
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
...name[exportnamelen] = '\0';
+ debug ("newstyle negotiation: NBD_OPT_GO: "
+ "client requested export '%s' (ignored)",
+ requested_exportname);
+
+ /* The spec is confusing, but it is required that we send back
+ * NBD_INFO_EXPORT, even if the client did not request it!
+ * qemu client in particular does not request this, but will
+ * fail if we don't send it.
+ */
+ if (get_size_and_eflags (conn) == -1)
+ return -1;
+ if (send_newstyle_option_reply_info_export (conn, option...
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 Apr 23
0
[nbdkit PATCH 6/7] nbd: Implement NBD_OPT_GO client request
...kit_error ("unable to request NBD_OPT_GO: %m");
+ return -1;
+ }
+ while (1) {
+ if (nbd_newstyle_recv_option_reply (h, NBD_OPT_GO, &reply, &buffer) < 0)
+ return -1;
+ switch (reply.reply) {
+ case NBD_REP_INFO:
+ /* Parse payload, but ignore all except NBD_INFO_EXPORT */
+ if (reply.replylen < 2) {
+ nbdkit_error ("NBD_REP_INFO reply too short");
+ free (buffer);
+ return -1;
+ }
+ memcpy (&info, buffer, sizeof info);
+ info = be16toh (info);
+ switch (info) {
+ case NBD_INFO_EXPORT:
+ if...
2018 Nov 29
2
[nbdkit PATCH] connections: Implement NBD_OPT_INFO
...debug ("newstyle negotiation: %s: "
"client requested export '%s' (ignored)",
- requested_exportname);
+ optname, requested_exportname);
/* The spec is confusing, but it is required that we send back
* NBD_INFO_EXPORT, even if the client did not request it!
@@ -855,8 +858,8 @@ _negotiate_handshake_newstyle_options (struct connection *conn)
switch (info) {
case NBD_INFO_EXPORT: /* ignore - reply sent above */ break;
default:
- debug ("newstyle negotiation: NBD_OPT_...
2019 Sep 25
0
[nbdkit PATCH 2/2] common/protocol: Declare additional constants
...+#define NBD_FLAG_FIXED_NEWSTYLE (1 << 0)
+#define NBD_FLAG_NO_ZEROES (1 << 1)
/* Per-export flags. */
#define NBD_FLAG_HAS_FLAGS (1 << 0)
@@ -143,6 +143,9 @@ struct nbd_fixed_new_option_reply {
#define NBD_REP_ERR_TOO_BIG NBD_REP_ERR (9)
#define NBD_INFO_EXPORT 0
+#define NBD_INFO_NAME 1
+#define NBD_INFO_DESCRIPTION 2
+#define NBD_INFO_BLOCK_SIZE 3
/* NBD_INFO_EXPORT reply (follows fixed_new_option_reply). */
struct nbd_fixed_new_option_reply_info_export {
--
2.21.0
2019 Sep 25
0
[libnbd PATCH] lib: Synchronize nbd-protocol.h with nbdkit, again
...+#define NBD_FLAG_FIXED_NEWSTYLE (1 << 0)
+#define NBD_FLAG_NO_ZEROES (1 << 1)
/* Per-export flags. */
#define NBD_FLAG_HAS_FLAGS (1 << 0)
@@ -140,6 +143,9 @@ struct nbd_fixed_new_option_reply {
#define NBD_REP_ERR_TOO_BIG NBD_REP_ERR (9)
#define NBD_INFO_EXPORT 0
+#define NBD_INFO_NAME 1
+#define NBD_INFO_DESCRIPTION 2
+#define NBD_INFO_BLOCK_SIZE 3
/* NBD_INFO_EXPORT reply (follows fixed_new_option_reply). */
struct nbd_fixed_new_option_reply_info_export {
@@ -160,15 +166,6 @@ struct nbd_block_descriptor {
uint32_t status_flags;...
2020 Sep 21
0
[nbdkit PATCH v3 03/14] server: Respond to NBD_INFO_NAME request
...uint32_t context_id,
@@ -533,16 +564,37 @@ negotiate_handshake_newstyle_options (void)
exportsize) == -1)
return -1;
- /* For now we ignore all other info requests (but we must
- * ignore NBD_INFO_EXPORT if it was requested, because we
- * replied already above). Therefore this loop doesn't do
- * much at the moment.
+ /* For now we send NBD_INFO_NAME if requested, and ignore all
+ * other info requests (including NBD_INFO_EXPORT if it was
+ * requested,...
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 Sep 24
0
[PATCH nbdkit 2/4] common/protocol: Remove protostrings.sed, use bash+sed instead.
...+#include "nbd-protocol.h"
+EOF
-# Match the precise sections of the source file.
-/^extern const char \*name_of_/,/^$/ {
+declare -A functions=(
+ [global_flag]=NBD_FLAG_FIXED_NEWSTYLE
+ [flag]=NBD_FLAG_HAS_FLAGS
+ [opt]=NBD_OPT_EXPORT_NAME
+ [rep]=NBD_REP_ACK
+ [info]=NBD_INFO_EXPORT
+ [reply]=NBD_REPLY_FLAG_DONE
+ [reply_type]=NBD_REPLY_TYPE_NONE
+ [cmd]=NBD_CMD_READ
+ [cmd_flag]=NBD_CMD_FLAG_FUA
+ [error]=NBD_SUCCESS
+)
- # Convert extern function prototype into a definition.
- s/extern \(const char \*name_of_.*\) (int);/\1 (int fl) {\
- switch (fl) {/;
-...
2019 Sep 25
3
[nbdkit PATCH 0/2] more protocol.h tweaks
More nbd-protocol.h improvements
Eric Blake (2):
common/protocol: Switch nbdmagic to uint64_t
common/protocol: Declare additional constants
common/protocol/nbd-protocol.h | 16 ++++++++++------
server/protocol-handshake-newstyle.c | 2 +-
server/protocol-handshake-oldstyle.c | 2 +-
plugins/nbd/nbd-standalone.c | 2 +-
tests/test-layers.c | 2 +-
5 files
2018 Dec 06
0
[PATCH nbdkit 3/5] protocol: Generate map functions from NBD protocol flags to printable strings.
...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_new_option_reply). */
@@ -148,6 +153,8 @@ struct reply {
#define NBD_REQUEST_MAGIC 0x25609513
#define NBD_REPLY_MAGIC 0x67446698
+/* NBD commands. */
+extern const char *name_of_nbd_cmd (int);
#define NBD_CMD_READ 0
#define NBD_CM...
2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
...NBD_REP_ERR (4)
+#define NBD_REP_ERR_TLS_REQD NBD_REP_ERR (5)
+#define NBD_REP_ERR_UNKNOWN NBD_REP_ERR (6)
+#define NBD_REP_ERR_SHUTDOWN NBD_REP_ERR (7)
+#define NBD_REP_ERR_BLOCK_SIZE_REQD NBD_REP_ERR (8)
+#define NBD_REP_ERR_TOO_BIG NBD_REP_ERR (9)
#define NBD_INFO_EXPORT 0
/* NBD_INFO_EXPORT reply (follows fixed_new_option_reply). */
-struct fixed_new_option_reply_info_export {
+struct nbd_fixed_new_option_reply_info_export {
uint16_t info; /* NBD_INFO_EXPORT */
uint64_t exportsize; /* size of export */
uint16_t eflags;...
2019 Aug 30
0
[nbdkit PATCH 5/9] server: Cache per-connection size
...options (conn) == -1)
+ if (finish_newstyle_options (conn, &exportsize) == -1)
return -1;
if (send_newstyle_option_reply_info_export (conn, option,
NBD_REP_INFO,
- NBD_INFO_EXPORT) == -1)
+ NBD_INFO_EXPORT,
+ exportsize) == -1)
return -1;
/* For now we ignore all other info requests (but we must
diff --git a/server/protocol-handshake-oldstyle.c b/server/...
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 Apr 25
6
[nbdkit PATCH v2 0/5] structured replies/.extents for nbd plugin
Updated based on other changes that have happened in the meantime:
- rely more on cleanup.h (throughout)
- split structured read for easier review (patch 2 and 3 were combined in v1)
- rely on nbdkit not leaking a server's partial answer (patch 3)
- add tests (patch 5)
- other bug fixes I found while testing it
- drop EOVERFLOW patch for now; it will be separate once upstream
NBD protocol
2019 Apr 23
12
[nbdkit PATCH 0/7] Implement structured replies in nbd plugin
I'm hoping to implement .extents for the nbd plugin; this is a
prerequisite. I'm not sure about patch 3 - if we like it, I'll
squash it to 2, if we don't, I think we are okay just dropping
it. I'm also wondering if we have to worry about malicious
plugins that don't populate the entire .pread buffer in an
effort to get nbdkit to expose portions of the heap; my patch 7
loses
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...ame[exportnamelen] = '\0';
- debug ("newstyle negotiation: %s: "
- "client requested export '%s' (ignored)",
- optname, requested_exportname);
-
- /* The spec is confusing, but it is required that we send back
- * NBD_INFO_EXPORT, even if the client did not request it!
- * qemu client in particular does not request this, but will
- * fail if we don't send it.
- */
- if (finish_newstyle_options (conn) == -1)
- return -1;
-
- if (send_newstyle_option_reply_info_export (conn,...
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.
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...ffer;
- struct fixed_new_option_reply_info_export *reply_export;
- uint16_t info;
-
- if (nbdplug_newstyle_recv_option_reply (h, NBD_OPT_GO, &reply, &buffer) < 0)
- return -1;
- switch (reply.reply) {
- case NBD_REP_INFO:
- /* Parse payload, but ignore all except NBD_INFO_EXPORT */
- if (reply.replylen < 2) {
- nbdkit_error ("NBD_REP_INFO reply too short");
- return -1;
- }
- memcpy (&info, buffer, sizeof info);
- info = be16toh (info);
- switch (info) {
- case NBD_INFO_EXPORT:
- if (reply.replylen != size...