From: Alex Bligh <alex@alex.org.uk>
To: Eric Blake <eblake@redhat.com>, Wouter Verhelst <w@uter.be>
Cc: "nbd-general@lists.sourceforge.net"
<nbd-general@lists.sourceforge.net>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Alex Bligh <alex@alex.org.uk>
Subject: [Qemu-devel] [PATCHv2 1/2] proto.md: Clearly set out NBDMAGIC is the actual value
Date: Fri, 1 Apr 2016 11:46:29 +0100 [thread overview]
Message-ID: <1459507590-1191-1-git-send-email-alex@alex.org.uk> (raw)
Clearly set out NBDMAGIC, not the name of a constant equal to
some value. Set out the value in hex as well.
Document the newstyle magic number is "IHAVEOPT".
Signed-off-by: Alex Bligh <alex@alex.org.uk>
---
doc/proto.md | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/doc/proto.md b/doc/proto.md
index 03dfe2b..8376021 100644
--- a/doc/proto.md
+++ b/doc/proto.md
@@ -67,7 +67,8 @@ 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,8 +97,10 @@ 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, `0x49484156454F5054` (note different magic number)
+S: 64 bits, `0x4e42444d41474943` (ASCII '`NBDMAGIC`') (as in the old
+ style handshake)
+S: 64 bits, `0x49484156454F5054` (ASCII '`IHAVEOPT`') (note different
+ magic number)
S: 16 bits, handshake flags
C: 32 bits, flags
@@ -113,7 +116,8 @@ At this point, we move on to option haggling, during which point the
client can send one or (in fixed newstyle) more options to the server.
The generic format of setting an option is as follows:
-C: 64 bits, `0x49484156454F5054` (note same newstyle handshake's magic number)
+C: 64 bits, `0x49484156454F5054` (ASCII '`IHAVEOPT`') (note same
+ newstyle handshake's magic number)
C: 32 bits, option
C: 32 bits, length of option data (unsigned)
C: any data needed for the chosen option, of length as specified above.
--
1.9.1
next reply other threads:[~2016-04-01 10:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 10:46 Alex Bligh [this message]
2016-04-01 10:46 ` [Qemu-devel] [PATCHv2 2/2] Correct definition of NBD_CMD_FLAG_FUA Alex Bligh
2016-04-01 13:29 ` Eric Blake
2016-04-01 13:29 ` [Qemu-devel] [PATCHv2 1/2] proto.md: Clearly set out NBDMAGIC is the actual value Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459507590-1191-1-git-send-email-alex@alex.org.uk \
--to=alex@alex.org.uk \
--cc=eblake@redhat.com \
--cc=nbd-general@lists.sourceforge.net \
--cc=qemu-devel@nongnu.org \
--cc=w@uter.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).