]> git.proxmox.com Git - mirror_qemu.git/commit
nbd/client: Relax handling of large NBD_CMD_BLOCK_STATUS reply
authorEric Blake <eblake@redhat.com>
Thu, 3 May 2018 22:26:26 +0000 (17:26 -0500)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 11 Jul 2018 16:48:22 +0000 (11:48 -0500)
commit6951158023e7923c18b0185d1eb48937767c7e8a
tree131c3a0191b1e19fac33017d0383db7e5dcce01f
parentb129914a8dbb4ad85c31f805e7444860661b0fff
nbd/client: Relax handling of large NBD_CMD_BLOCK_STATUS reply

The NBD spec is proposing a relaxation of NBD_CMD_BLOCK_STATUS
where a server may have the final extent per context give a
length beyond the original request, if it can easily prove that
subsequent bytes have the same status, on the grounds that a
client can take advantage of this information for fewer block
status requests.  Since qemu 2.12 as a client always sends
NBD_CMD_FLAG_REQ_ONE, and rejects a server that sends extra
length, the upstream NBD spec will probably limit this behavior
to clients that don't request REQ_ONE semantics; but it doesn't
hurt to relax qemu to always be permissive of this server
behavior, even if it continues to use REQ_ONE.

CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180503222626.1303410-1-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
(cherry picked from commit acfd8f7a5f92e703d2d046cbe3d510008a697194)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/nbd-client.c