nbd/server: Refactor to pass full request around
commit66d4f4fe2f1c282a34a429f61aa4283e60336500
authorEric Blake <eblake@redhat.com>
Thu, 8 Jun 2023 13:56:33 +0000 (8 08:56 -0500)
committerEric Blake <eblake@redhat.com>
Wed, 19 Jul 2023 20:25:27 +0000 (19 15:25 -0500)
treefba4d59f0706638ae3e07023b6431030c312d86f
parenta7c8ed36bf9d3b7f75faefb5bb01535eb818e260
nbd/server: Refactor to pass full request around

Part of NBD's 64-bit headers extension involves passing the client's
requested offset back as part of the reply header (one reason it
stated for this change: converting absolute offsets stored in
NBD_REPLY_TYPE_OFFSET_DATA to relative offsets within the buffer is
easier if the absolute offset of the buffer is also available).  This
is a refactoring patch to pass the full request around the reply
stack, rather than just the handle, so that later patches can then
access request->from when extended headers are active.  Meanwhile,
this patch enables us to now assert that simple replies are only
attempted when appropriate, and otherwise has no semantic change.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-ID: <20230608135653.2918540-5-eblake@redhat.com>
nbd/server.c