[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 4/9] proto.md: Document historic values for magics, reserve new value



From: Manfred Spraul <manfred.spraul@de.bosch.com>

Right now:
- The historic values for NBD_REQUEST_MAGIC and NBD_REPLY_MAGIC are
  just documented in nbd.h, without any background.
- The new value that is now used for internal use by nbd-server is
  not documented at all.

Resolve that:
- Add all required information to proto.md.
- Remove the reserved magic values from nbd.h: proto.md is the
  authorative source, double storage doesn't help.

Signed-off-by: Manfred Spraul <manfred.spraul@de.bosch.com>
---
 doc/proto.md | 12 ++++++++++++
 nbd.h        |  1 -
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/proto.md b/doc/proto.md
index 3a877a9..81ac755 100644
--- a/doc/proto.md
+++ b/doc/proto.md
@@ -458,6 +458,18 @@ SHOULD wait until there are no inflight requests first.
 The client and the server MUST NOT initiate any form
 of disconnect other than in one of the above circumstances.
 
+#### Reserved Magic values
+
+The following magic values are reserved and must not be used
+for future protocol extentions:
+
+0x12560953 - Historic value for NBD_REQUEST_MAGIC, used
+	     until Linux 2.1.116pre2.
+0x96744668 - Historic value for NBD_REPLY_MAGIC, used
+	     until Linux 2.1.116pre2.
+0x25609514 - Used by nbd-server to store data log flags in the
+	     transaction log. Never sent from/to a client.
+
 ## TLS support
 
 The NBD protocol supports Transport Layer Security (TLS) (see
diff --git a/nbd.h b/nbd.h
index 31462aa..841d0e5 100644
--- a/nbd.h
+++ b/nbd.h
@@ -68,7 +68,6 @@ enum {
 
 /* for the trace log, not part of the protocol, not sent over the wire */
 #define NBD_TRACELOG_MAGIC 0x25609514
-/* Do *not* use magics: 0x12560953 0x96744668. */
 
 #define NBD_OPT_REPLY_MAGIC 0x3e889045565a9LL
 
-- 
2.34.1


Reply to: