diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-11-13 13:13:12 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-11-13 13:13:12 +0000 |
commit | f291910db61b5812e68f1e76afb3ade41d567bea (patch) | |
tree | a918fd3e151b08ad7ec7e50a1cbbe4a1f60a5709 /include | |
parent | 508ba0f7e2092d3ca56e3f75e894d52d8b94818e (diff) | |
parent | ef8c887ee01a4e4c8c5c28c86ea5b45162c51bcd (diff) |
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-11-09' into staging
nbd patches for 2017-11-09
- Vladimir Sementsov-Ogievskiy: nbd/server: fix nbd_negotiate_handle_info
- Eric Blake: 0/7 various NBD fixes for 2.11
# gpg: Signature made Thu 09 Nov 2017 16:56:58 GMT
# gpg: using RSA key 0xA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>"
# gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
# gpg: aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A
* remotes/ericb/tags/pull-nbd-2017-11-09:
nbd/server: Fix structured read of length 0
nbd-client: Stricter enforcing of structured reply spec
nbd-client: Short-circuit 0-length operations
nbd: Fix struct name for structured reads
nbd/client: Nicer trace of structured reply
nbd-client: Refuse read-only client with BDRV_O_RDWR
nbd-client: Fix error message typos
nbd/server: fix nbd_negotiate_handle_info
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/nbd.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index 92d1723d7c..113c707a5e 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -86,15 +86,23 @@ typedef union NBDReply { } QEMU_PACKED; } NBDReply; -/* Header of NBD_REPLY_TYPE_OFFSET_DATA, complete NBD_REPLY_TYPE_OFFSET_HOLE */ -typedef struct NBDStructuredRead { - NBDStructuredReplyChunk h; +/* Header of chunk for NBD_REPLY_TYPE_OFFSET_DATA */ +typedef struct NBDStructuredReadData { + NBDStructuredReplyChunk h; /* h.length >= 9 */ uint64_t offset; -} QEMU_PACKED NBDStructuredRead; + /* At least one byte of data payload follows, calculated from h.length */ +} QEMU_PACKED NBDStructuredReadData; + +/* Complete chunk for NBD_REPLY_TYPE_OFFSET_HOLE */ +typedef struct NBDStructuredReadHole { + NBDStructuredReplyChunk h; /* h.length == 12 */ + uint64_t offset; + uint32_t length; +} QEMU_PACKED NBDStructuredReadHole; /* Header of all NBD_REPLY_TYPE_ERROR* errors */ typedef struct NBDStructuredError { - NBDStructuredReplyChunk h; + NBDStructuredReplyChunk h; /* h.length >= 6 */ uint32_t error; uint16_t message_length; } QEMU_PACKED NBDStructuredError; |