]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend
authorallanjude <allanjude@FreeBSD.org>
Thu, 23 Apr 2020 19:20:58 +0000 (19:20 +0000)
committerallanjude <allanjude@FreeBSD.org>
Thu, 23 Apr 2020 19:20:58 +0000 (19:20 +0000)
commita68a4170bf925b0fb9e242a960a4016da15738b8
tree9a0efe037b5e4aabe2426faa61be10b542b1a433
parentf0197bb22b46c53f3d0a50825d1f0139c406490d
Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend

This will advertise support for TRIM to the guest virtio-blk driver and
perform the DIOCGDELETE ioctl on the backing storage if it supports it.

Thanks to Jason King and others at Joyent and illumos for expanding on
my original patch, adding improvements including better error handling
and making sure to following the virtio spec.

Submitted by: Jason King <jason.king@joyent.com> (improvements)
Reviewed by: jhb
Obtained from: illumos-joyent (improvements)
MFC after: 1 month
Relnotes: yes
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D21707
usr.sbin/bhyve/block_if.c
usr.sbin/bhyve/pci_virtio_block.c