search for: nbd_magic

Displaying 3 results from an estimated 3 matches for "nbd_magic".

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
...diff --git a/lib/nbd-protocol.h b/lib/nbd-protocol.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_...
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...err; - } - - /* old and new handshake share same meaning of first 16 bytes */ - if (read_full (h->fd, &old, - offsetof (struct nbd_old_handshake, 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 *) &amp...