[Devel] [PATCH hci-8.2 v4] drivers/vhost/blk: support VIRTIO_BLK_F_WRITE_ZEROES

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Wed Nov 18 14:13:33 MSK 2026


> Handle VIRTIO_BLK_T_WRITE_ZEROES for parity with virtio-blk. The range
> is sent to the backend as a single REQ_OP_WRITE_ZEROES bio, with
> REQ_NOUNMAP unless the guest set the UNMAP flag.
> 
> The VMM advertises the feature only for a backend with WRITE ZEROES
> support and sets max_write_zeroes_sectors from its limit, capped at
> 8388607 so that the range fits in one bio, and max_write_zeroes_seg
> to 1.
> 
> The guest gets VIRTIO_BLK_S_UNSUPP when VIRTIO_BLK_F_WRITE_ZEROES was
> not negotiated, for a payload other than exactly one segment or an
> unknown flag. It gets VIRTIO_BLK_S_IOERR for a read-only backend, a
> backend without WRITE ZEROES and a range that is unaligned, beyond the
> capacity or above these limits.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-141684
> Feature: vhost-blk: in-kernel accelerator for virtio-blk guests
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261118110813.3333232-1-alexander.ivanov@virtuozzo.com?part=1




More information about the Devel mailing list