[Devel] [PATCH hci-8.2 0/2] drivers/vhost/blk: support VIRTIO_BLK_F_DISCARD

Alexander Ivanov alexander.ivanov at virtuozzo.com
Mon Nov 23 11:40:12 MSK 2026


vhost-blk does not offer VIRTIO_BLK_F_DISCARD, so a guest on vhost-blk
cannot release unused blocks of its disk, while virtio-blk in QEMU can.

Patch 1 drops the ring features that are already part of VHOST_FEATURES.
Patch 2 handles VIRTIO_BLK_T_DISCARD as a single-segment request sent
to the backend as one REQ_OP_DISCARD bio.

The QEMU side advertises the discard limits in the config space and is
sent separately.

https://virtuozzo.atlassian.net/browse/VSTOR-141683

Alexander Ivanov (2):
  drivers/vhost/blk: drop ring features already in VHOST_FEATURES
  drivers/vhost/blk: support VIRTIO_BLK_F_DISCARD

 drivers/vhost/blk.c | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)

-- 
2.53.0



More information about the Devel mailing list