From: Vladimir Sementsov-Ogievskiy Date: Wed, 1 Apr 2020 15:01:08 +0000 (+0300) Subject: block/nbd-client: drop max_block restriction from discard X-Git-Tag: v5.1.0~205^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=714eb0dbc5480c8a9d9f39eb931cb5d2acc1b6c6;p=mirror_qemu.git block/nbd-client: drop max_block restriction from discard 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 Message-Id: <20200401150112.9557-3-vsementsov@virtuozzo.com> Reviewed-by: Eric Blake [eblake: tweak commit message to call out NBD commit] Signed-off-by: Eric Blake --- diff --git a/block/nbd.c b/block/nbd.c index d4d518a780..4ac23c8f62 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -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;