Displaying 14 results from an estimated 14 matches for "nbd_old_version".
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
2019 Sep 25
0
[libnbd PATCH] lib: Synchronize nbd-protocol.h with nbdkit, again
...col.h
index fe4d451..bdd1ef2 100644
--- a/lib/nbd-protocol.h
+++ b/lib/nbd-protocol.h
@@ -50,7 +50,7 @@
/* Old-style handshake. */
struct nbd_old_handshake {
- char nbdmagic[8]; /* "NBDMAGIC" */
+ uint64_t nbdmagic; /* NBD_MAGIC */
uint64_t version; /* NBD_OLD_VERSION */
uint64_t exportsize;
uint16_t gflags; /* global flags */
@@ -58,30 +58,33 @@ struct nbd_old_handshake {
char zeroes[124]; /* must be sent as zero bytes */
} NBD_ATTRIBUTE_PACKED;
+#define NBD_MAGIC UINT64_C(0x4e42444d41474943) /* ASCII "NBDMAGIC" *...
2019 Sep 24
0
[PATCH nbdkit 3/4] common/protocol: Update nbd-protocol.h so it matches libnbd’s copy.
....
*/
+#define NBD_MAX_STRING 4096 /* Maximum length of a string field */
+
/* Old-style handshake. */
-struct old_handshake {
+struct nbd_old_handshake {
char nbdmagic[8]; /* "NBDMAGIC" */
- uint64_t version; /* OLD_VERSION */
+ uint64_t version; /* NBD_OLD_VERSION */
uint64_t exportsize;
uint16_t gflags; /* global flags */
uint16_t eflags; /* per-export flags */
char zeroes[124]; /* must be sent as zero bytes */
} __attribute__((packed));
-#define OLD_VERSION UINT64_C(0x420281861253)
+#define NBD_OLD_VERSION UIN...
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 4/4] common/protocol: Install <nbd-protocol.h> as a public header.
...ld-style handshake. */
@@ -50,7 +56,7 @@ struct nbd_old_handshake {
uint16_t gflags; /* global flags */
uint16_t eflags; /* per-export flags */
char zeroes[124]; /* must be sent as zero bytes */
-} __attribute__((packed));
+} NBD_ATTRIBUTE_PACKED;
#define NBD_OLD_VERSION UINT64_C(0x420281861253)
@@ -59,7 +65,7 @@ struct nbd_new_handshake {
char nbdmagic[8]; /* "NBDMAGIC" */
uint64_t version; /* NBD_NEW_VERSION */
uint16_t gflags; /* global flags */
-} __attribute__((packed));
+} NBD_ATTRIBUTE_PACKED;
#define NB...
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...STATE_MACHINE {
> }
>
> version = be64toh (h->sbuf.new_handshake.version);
> - if (version == NBD_NEW_VERSION)
> + if (version == NBD_NEW_VERSION) {
> + h->sbuf.option.option = 0;
> SET_NEXT_STATE (%.NEWSTYLE.START);
> + }
> else if (version == NBD_OLD_VERSION)
> SET_NEXT_STATE (%.OLDSTYLE.START);
> else {
What does this hunk do?
> diff --git a/generator/states-newstyle.c b/generator/states-newstyle.c
> index 573f724..e61f373 100644
> --- a/generator/states-newstyle.c
> +++ b/generator/states-newstyle.c
> @@ -1,5 +1,5 @@
&g...
2020 Aug 11
3
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...;
>> version = be64toh (h->sbuf.new_handshake.version);
>> - if (version == NBD_NEW_VERSION)
>> + if (version == NBD_NEW_VERSION) {
>> + h->sbuf.option.option = 0;
>> SET_NEXT_STATE (%.NEWSTYLE.START);
>> + }
>> else if (version == NBD_OLD_VERSION)
>> SET_NEXT_STATE (%.OLDSTYLE.START);
>> else {
>
> What does this hunk do?
>
>> diff --git a/generator/states-newstyle.c b/generator/states-newstyle.c
>> index 573f724..e61f373 100644
>> --- a/generator/states-newstyle.c
>> +++ b/generator/...
2020 Aug 11
0
Re: [libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...be64toh (h->sbuf.new_handshake.version);
>>> - if (version == NBD_NEW_VERSION)
>>> + if (version == NBD_NEW_VERSION) {
>>> + h->sbuf.option.option = 0;
>>> SET_NEXT_STATE (%.NEWSTYLE.START);
>>> + }
>>> else if (version == NBD_OLD_VERSION)
>>> SET_NEXT_STATE (%.OLDSTYLE.START);
>>> else {
>>
>> What does this hunk do?
The existing NEWSTYLE.START handles gflags/cflags prior to moving into
NBD_OPT code, and was only ever reachable once. This patch adds a
transition from NEGOTIATING to NEWSTY...
2019 Sep 24
2
[PATCH libnbd] lib: Copy nbd-protocol.h from nbdkit 1.15.3.
...ld-style handshake. */
@@ -55,7 +56,7 @@ struct nbd_old_handshake {
uint16_t gflags; /* global flags */
uint16_t eflags; /* per-export flags */
char zeroes[124]; /* must be sent as zero bytes */
-} __attribute__((packed));
+} NBD_ATTRIBUTE_PACKED;
#define NBD_OLD_VERSION UINT64_C(0x420281861253)
@@ -64,7 +65,7 @@ struct nbd_new_handshake {
char nbdmagic[8]; /* "NBDMAGIC" */
uint64_t version; /* NBD_NEW_VERSION */
uint16_t gflags; /* global flags */
-} __attribute__((packed));
+} NBD_ATTRIBUTE_PACKED;
#define NB...
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...GNU Lesser General Public
@@ -42,8 +42,10 @@ STATE_MACHINE {
}
version = be64toh (h->sbuf.new_handshake.version);
- if (version == NBD_NEW_VERSION)
+ if (version == NBD_NEW_VERSION) {
+ h->sbuf.option.option = 0;
SET_NEXT_STATE (%.NEWSTYLE.START);
+ }
else if (version == NBD_OLD_VERSION)
SET_NEXT_STATE (%.OLDSTYLE.START);
else {
diff --git a/generator/states-newstyle-opt-go.c b/generator/states-newstyle-opt-go.c
index 1e75e0a..daafe91 100644
--- a/generator/states-newstyle-opt-go.c
+++ b/generator/states-newstyle-opt-go.c
@@ -202,6 +202,10 @@ STATE_MACHINE {
set_e...
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...U Lesser General Public
@@ -42,8 +42,10 @@ STATE_MACHINE {
}
version = be64toh (h->sbuf.new_handshake.version);
- if (version == NBD_NEW_VERSION)
+ if (version == NBD_NEW_VERSION) {
+ assert (h->current_opt == 0);
SET_NEXT_STATE (%.NEWSTYLE.START);
+ }
else if (version == NBD_OLD_VERSION)
SET_NEXT_STATE (%.OLDSTYLE.START);
else {
diff --git a/generator/states-newstyle-opt-go.c b/generator/states-newstyle-opt-go.c
index d696cae..1a59ae7 100644
--- a/generator/states-newstyle-opt-go.c
+++ b/generator/states-newstyle-opt-go.c
@@ -240,7 +240,7 @@ STATE_MACHINE {
set_erro...
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...hake, exportsize))) {
- nbdkit_error ("unable to read magic: %m");
- goto err;
- }
- if (be64toh (old.nbdmagic) != NBD_MAGIC) {
- nbdkit_error ("wrong magic, %s is not an NBD server", servname);
- goto err;
- }
- version = be64toh (old.version);
- if (version == NBD_OLD_VERSION) {
- nbdkit_debug ("trying oldstyle connection");
- if (read_full (h->fd,
- (char *) &old + offsetof (struct nbd_old_handshake, exportsize),
- sizeof old - offsetof (struct nbd_old_handshake, exportsize))) {
- nbdkit_error ("unabl...
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
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):