If the hypervisor advertises support for the DISCARD command then the
guest can perform TRIM commands, freeing space on the backing store.
If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE
Differential D21708
Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver allanjude on Sep 18 2019, 7:24 PM. Authored by Tags None Referenced Files
Details
If the hypervisor advertises support for the DISCARD command then the If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE
Diff Detail
Event Timeline
Comment Actions Address most of cem's feedback
Comment Actions I've created some images for people to test in other hypervisors. A build of -current from this morning, with this patch applied: http://trooper.hml3.scaleengine.net/freebsd_virtio_trim_r362891.vmdk http://trooper.hml3.scaleengine.net/freebsd_virtio_trim_r362891.raw Comment Actions I haven't reviewed the code, but I did a basic test in bhyve and it put zeros on the disk in an instant :) |