Skip to contentSkip to conversation

proto.md: Clearly set out NBDMAGIC is the actual value

PATCH Superseded Alex Bligh 2 participants 2 messages Mar 31, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alex Bligh

author
#0 lore raw

PATCH 1/2 proto.md: Clearly set out NBDMAGIC is the actual value

Clearly set out NBDMAGIC, not the name of a constant equal to some value. Set out the value in hex as well.

---
 doc/proto.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
doc/proto.md +2 -2
index c1e05c5..7994076 100644
@@ -67,7 +67,7 @@ newstyle negotiation.
 
 #### Oldstyle negotiation
 
-S: 64 bits, `NBDMAGIC` (also known as the `INIT_PASSWD`)  
+S: 64 bits, `0x4e42444d41474943` (ASCII '`NBDMAGIC`') (also known as the `INIT_PASSWD`)  
 S: 64 bits, `0x00420281861253` (`cliserv_magic`, a magic number)  
 S: 64 bits, size of the export in bytes (unsigned)  
 S: 32 bits, flags  
@@ -96,7 +96,7 @@ production purposes.
 
 The initial few exchanges in newstyle negotiation look as follows:
 
-S: 64 bits, `NBDMAGIC` (as in the old style handshake)  
+S: 64 bits, `0x4e42444d41474943` (ASCII '`NBDMAGIC`') (as in the old style handshake)  
 S: 64 bits, `0x49484156454F5054` (note different magic number)  
 S: 16 bits, handshake flags  
 C: 32 bits, flags  
Signature · 1 line
1.9.1
#1 lore raw
Quoted 22 lines · Alex Bligh

Clearly set out NBDMAGIC, not the name of a constant equal to some value. Set out the value in hex as well.

---
 doc/proto.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
doc/proto.md +1 -1
index c1e05c5..7994076 100644
@@ -67,7 +67,7 @@ newstyle negotiation.
 
 #### Oldstyle negotiation
 
-S: 64 bits, `NBDMAGIC` (also known as the `INIT_PASSWD`)  
+S: 64 bits, `0x4e42444d41474943` (ASCII '`NBDMAGIC`') (also known as the `INIT_PASSWD`)  
 S: 64 bits, `0x00420281861253` (`cliserv_magic`, a magic number)  
 S: 64 bits, size of the export in bytes (unsigned)  
 S: 32 bits, flags  

doc/proto.md production purposes. · line 99

Quoted 5 lines
doc/proto.md +1 -1
@@ -96,7 +96,7 @@ production purposes.
 
 The initial few exchanges in newstyle negotiation look as follows:
 
-S: 64 bits, `NBDMAGIC` (as in the old style handshake)  
+S: 64 bits, `0x4e42444d41474943` (ASCII '`NBDMAGIC`') (as in the old style handshake)  

Markdown doesn't care, but the rest of this file is less than 80 columns, making this a long line. You can wrap it (see how I wrapped the line regarding 124 bytes of zeroes in response to NBD_OPT_EXPORT_NAME).

doc/proto.md production purposes. · line 100

Quoted 1 line
doc/proto.md +0 -0
 S: 64 bits, `0x49484156454F5054` (note different magic number)  

As long as we are spelling out ASCII counterpart, is it worth mentioning that this is (ASCII 'IHAVEOPT')?

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org