aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2023-08-29 12:58:30 -0500
committerEric Blake <eblake@redhat.com>2023-09-22 17:21:08 -0500
commitd95ffb6fe6008c114602e20d848100081d62f7aa (patch)
tree6e051c4a1e55a3ba7dec997426a9a4ab450b4df2 /block
parent297365b40ff24c7e07d6f40ec8f9ac83229ace94 (diff)
nbd: Add types for extended headers
Add the constants and structs necessary for later patches to start implementing the NBD_OPT_EXTENDED_HEADERS extension in both the client and server, matching recent upstream nbd.git (through commit e6f3b94a934). This patch does not change any existing behavior, but merely sets the stage for upcoming patches. This patch does not change the status quo that neither the client nor server use a packed-struct representation for the request header. While most of the patch adds new types, there is also some churn for renaming the existing NBDExtent to NBDExtent32 to contrast it with NBDExtent64, which I thought was a nicer name than NBDExtentExt. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-ID: <20230829175826.377251-22-eblake@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/nbd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 24f50b79e4..9e99a4ddb5 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -610,7 +610,7 @@ static int nbd_parse_offset_hole_payload(BDRVNBDState *s,
static int nbd_parse_blockstatus_payload(BDRVNBDState *s,
NBDStructuredReplyChunk *chunk,
uint8_t *payload, uint64_t orig_length,
- NBDExtent *extent, Error **errp)
+ NBDExtent32 *extent, Error **errp)
{
uint32_t context_id;
@@ -1118,7 +1118,7 @@ nbd_co_receive_cmdread_reply(BDRVNBDState *s, uint64_t cookie,
static int coroutine_fn
nbd_co_receive_blockstatus_reply(BDRVNBDState *s, uint64_t cookie,
- uint64_t length, NBDExtent *extent,
+ uint64_t length, NBDExtent32 *extent,
int *request_ret, Error **errp)
{
NBDReplyChunkIter iter;
@@ -1373,7 +1373,7 @@ static int coroutine_fn GRAPH_RDLOCK nbd_client_co_block_status(
int64_t *pnum, int64_t *map, BlockDriverState **file)
{
int ret, request_ret;
- NBDExtent extent = { 0 };
+ NBDExtent32 extent = { 0 };
BDRVNBDState *s = (BDRVNBDState *)bs->opaque;
Error *local_err = NULL;