nbd/server: Prepare for per-request filtering of BLOCK_STATUS
commitcd34820ff0db2bc0896576ec2cd9ca1caabc3ba0
authorEric Blake <eblake@redhat.com>
Tue, 6 Jun 2023 19:24:05 +0000 (6 14:24 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 10 Aug 2023 14:44:02 +0000 (10 09:44 -0500)
tree651c07f39f959381e5b09fc5eff74136b6dfb40e
parent0120ed84595e1c40780cb2ecc7c61b230c68b525
nbd/server: Prepare for per-request filtering of BLOCK_STATUS

The next commit will add support for the optional extension
NBD_CMD_FLAG_PAYLOAD during NBD_CMD_BLOCK_STATUS, where the client can
request that the server only return a subset of negotiated contexts,
rather than all contexts.  To make that task easier, this patch
populates the list of contexts to return on a per-command basis (for
now, identical to the full set of negotiated contexts).

Signed-off-by: Eric Blake <eblake@redhat.com>
---

v5: fix null dereference on early error [Vladimir], hoist in assertion
from v4 24/24

v4: split out NBDMetaContexts refactoring to its own patch, track
NBDRequests.contexts as a pointer rather than inline
include/block/nbd.h
nbd/server.c