diff options
author | Eric Blake <eblake@redhat.com> | 2023-08-29 12:58:31 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2023-09-25 08:35:06 -0500 |
commit | b2578459323c56002b360f5fc02188be7f5ca4db (patch) | |
tree | 6914af3f76c19772b9e8b5833843c3515cac5873 /include/block | |
parent | d95ffb6fe6008c114602e20d848100081d62f7aa (diff) | |
download | qemu-b2578459323c56002b360f5fc02188be7f5ca4db.zip qemu-b2578459323c56002b360f5fc02188be7f5ca4db.tar.gz qemu-b2578459323c56002b360f5fc02188be7f5ca4db.tar.bz2 |
nbd: Prepare for 64-bit request effect lengths
Widen the length field of NBDRequest to 64-bits, although we can
assert that all current uses are still under 32 bits: either because
of NBD_MAX_BUFFER_SIZE which is even smaller (and where size_t can
still be appropriate, even on 32-bit platforms), or because nothing
ever puts us into NBD_MODE_EXTENDED yet (and while future patches will
allow larger transactions, the lengths in play here are still capped
at 32-bit). There are no semantic changes, other than a typo fix in a
couple of error messages.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-ID: <20230829175826.377251-23-eblake@redhat.com>
[eblake: fix assertion bug in nbd_co_send_simple_reply]
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/nbd.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index 22a9b5d..8a765e7 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -71,8 +71,8 @@ typedef enum NBDMode { */ typedef struct NBDRequest { uint64_t cookie; - uint64_t from; - uint32_t len; + uint64_t from; /* Offset touched by the command */ + uint64_t len; /* Effect length; 32 bit limit without extended headers */ uint16_t flags; /* NBD_CMD_FLAG_* */ uint16_t type; /* NBD_CMD_* */ NBDMode mode; /* Determines which network representation to use */ |