> QEMU virtio-blk advertises WRITE_ZEROES, so a guest switched to > vhost-blk may issue such requests and gets VIRTIO_BLK_S_UNSUPP. > > Handle VIRTIO_BLK_T_WRITE_ZEROES with __blkdev_issue_zeroout(), which > splits the range by the device limit and falls back to writing zero > pages when the backend has no WRITE ZEROES support. The UNMAP flag > maps to the absence of BLKDEV_ZERO_NOUNMAP. Only a single segment per > request is accepted, as in QEMU, so the device config must report > max_write_zeroes_seg = 1. The segment is taken from the device-readable > part of the chain, where the virtio spec places it. > > Complete a range not aligned to the logical block size and a request > to a read-only backend with VIRTIO_BLK_S_IOERR, as QEMU does. The > backend is read-only as for VIRTIO_BLK_T_OUT: the fd lacks FMODE_WRITE > or the bdev is read-only. BLKROSET or set_disk_ro() may switch the bdev > [ ... ] > the limit has become zero instead of reporting VIRTIO_BLK_S_IOERR. > > https://virtuozzo.atlassian.net/browse/VSTOR-141684 > Feature: vhost-blk: in-kernel accelerator for virtio-blk guests > Signed-off-by: Alexander Ivanov <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.vzint.dev/#/patchset/[email protected]?part=1 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
