diff options
author | Eric Blake <eblake@redhat.com> | 2016-10-14 13:33:14 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-11-02 09:28:56 +0100 |
commit | c203c59ad9dc677b27e00ba76d221fd7e93c1aa6 (patch) | |
tree | 8d19b580c4128be92df039034cf12ea50068fc31 /include | |
parent | 75368aab9ba27f762acf5a51062c951a1fb1e006 (diff) |
nbd: Support shorter handshake
The NBD Protocol allows the server and client to mutually agree
on a shorter handshake (omit the 124 bytes of reserved 0), via
the server advertising NBD_FLAG_NO_ZEROES and the client
acknowledging with NBD_FLAG_C_NO_ZEROES (only possible in
newstyle, whether or not it is fixed newstyle). It doesn't
shave much off the wire, but we might as well implement it.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alex Bligh <alex@alex.org.uk>
Message-Id: <1476469998-28592-13-git-send-email-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/nbd.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index b69bf1dc68..d326308656 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -74,11 +74,13 @@ typedef struct NBDReply NBDReply; /* New-style handshake (global) flags, sent from server to client, and control what will happen during handshake phase. */ -#define NBD_FLAG_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */ +#define NBD_FLAG_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */ +#define NBD_FLAG_NO_ZEROES (1 << 1) /* End handshake without zeroes. */ /* New-style client flags, sent from client to server to control what happens during handshake phase. */ -#define NBD_FLAG_C_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */ +#define NBD_FLAG_C_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */ +#define NBD_FLAG_C_NO_ZEROES (1 << 1) /* End handshake without zeroes. */ /* Reply types. */ #define NBD_REP_ACK (1) /* Data sending finished. */ |