aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2023-09-25 14:22:37 -0500
committerEric Blake <eblake@redhat.com>2023-10-05 11:02:08 -0500
commit4fc55bf3b0608f15ce64d7b8cdaa95ac29e62d6c (patch)
treeb248179b61e3dabae075bdecf0f466cbad937f38 /block
parented6c996c673e3d64be1f060abc3a6999e007dae2 (diff)
downloadqemu-4fc55bf3b0608f15ce64d7b8cdaa95ac29e62d6c.zip
qemu-4fc55bf3b0608f15ce64d7b8cdaa95ac29e62d6c.tar.gz
qemu-4fc55bf3b0608f15ce64d7b8cdaa95ac29e62d6c.tar.bz2
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> Message-ID: <20230925192229.3186470-21-eblake@redhat.com> [eblake: fix trace format] Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'block')
-rw-r--r--block/nbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 22d3cb1..7646143 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -458,7 +458,7 @@ static coroutine_fn int nbd_receive_replies(BDRVNBDState *s, uint64_t cookie,
/* We are under mutex and cookie is 0. We have to do the dirty work. */
assert(s->reply.cookie == 0);
- ret = nbd_receive_reply(s->bs, s->ioc, &s->reply, errp);
+ ret = nbd_receive_reply(s->bs, s->ioc, &s->reply, s->info.mode, errp);
if (ret == 0) {
ret = -EIO;
error_setg(errp, "server dropped connection");