summaryrefslogtreecommitdiffstats
path: root/nbd
diff options
context:
space:
mode:
authorEric Blake2021-09-07 19:35:05 +0200
committerEric Blake2021-09-29 20:46:32 +0200
commitda24597dd37bc31b4d2328e5542fa3b5676a3fe0 (patch)
treebac7bfe0b817f945d0cd2be04a8611a15b4a00e4 /nbd
parentblock/io: allow 64bit discard requests (diff)
downloadqemu-da24597dd37bc31b4d2328e5542fa3b5676a3fe0.tar.gz
qemu-da24597dd37bc31b4d2328e5542fa3b5676a3fe0.tar.xz
qemu-da24597dd37bc31b4d2328e5542fa3b5676a3fe0.zip
nbd/server: Allow LIST_META_CONTEXT without STRUCTURED_REPLY
The NBD protocol just relaxed the requirements on NBD_OPT_LIST_META_CONTEXT: https://github.com/NetworkBlockDevice/nbd/commit/13a4e33a87 Since listing is not stateful (unlike SET_META_CONTEXT), we don't care if a client asks for meta contexts without first requesting structured replies. Well-behaved clients will still ask for structured reply first (if for no other reason than for back-compat to older servers), but that's no reason to avoid this change. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20210907173505.1499709-1-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'nbd')
-rw-r--r--nbd/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nbd/server.c b/nbd/server.c
index 3927f7789d..6d03e8a4b4 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -980,7 +980,7 @@ static int nbd_negotiate_meta_queries(NBDClient *client,
size_t i;
size_t count = 0;
- if (!client->structured_reply) {
+ if (client->opt == NBD_OPT_SET_META_CONTEXT && !client->structured_reply) {
return nbd_opt_invalid(client, errp,
"request option '%s' when structured reply "
"is not negotiated",