nbd/client: Initial support for extended headers
commit261fa0f79fabc6327cabdd148fd9fd00638d6d41
authorEric Blake <eblake@redhat.com>
Wed, 7 Jun 2023 20:08:07 +0000 (7 15:08 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 10 Aug 2023 14:44:02 +0000 (10 09:44 -0500)
tree56a76cdfe6ea01bf1ceeb5033e8740d5072c3b5b
parentea99f60e8a932a126f2ea0700e472e1ddc337979
nbd/client: Initial support for extended headers

Update the client code to be able to send an extended request, and
parse an extended header from the server.  Note that since we reject
any structured reply with a too-large payload, we can always normalize
a valid header back into the compact form, so that the caller need not
deal with two branches of a union.  Still, until a later patch lets
the client negotiate extended headers, the code added here should not
be reached.  Note that because of the different magic numbers, it is
just as easy to trace and then tolerate a non-compliant server sending
the wrong header reply as it would be to insist that the server is
compliant.

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

v5: fix logic bug on error reporting [Vladimir]

v4: split off errp handling to separate patch [Vladimir], better
function naming [Vladimir]
block/nbd.c
include/block/nbd.h
nbd/client.c
nbd/trace-events