]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/nbd-client: drop max_block restriction from discard
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Wed, 1 Apr 2020 15:01:08 +0000 (18:01 +0300)
committerEric Blake <eblake@redhat.com>
Mon, 4 May 2020 20:16:46 +0000 (15:16 -0500)
The NBD spec was updated (see nbd.git commit 9f30fedb) so that
max_block doesn't relate to NBD_CMD_TRIM. So, drop the restriction.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200401150112.9557-3-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: tweak commit message to call out NBD commit]
Signed-off-by: Eric Blake <eblake@redhat.com>
block/nbd.c

index d4d518a780c9f7d2d1f47cab90f9f068832c6a6f..4ac23c8f62994c025467f3958a6870ea2db89efd 100644 (file)
@@ -1955,7 +1955,7 @@ static void nbd_refresh_limits(BlockDriverState *bs, Error **errp)
     }
 
     bs->bl.request_alignment = min;
-    bs->bl.max_pdiscard = max;
+    bs->bl.max_pdiscard = QEMU_ALIGN_DOWN(INT_MAX, min);
     bs->bl.max_pwrite_zeroes = max;
     bs->bl.max_transfer = max;