HomeFreeBSD

MFC r360229, r363255

Description

MFC r360229, r363255
MFS r365614

r360229:
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.

r363255:
Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver

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

Tested with FreeBSD guests on bhyve and KVM

Approved by: re (gjb)
Relnotes: yes
Sponsored by: Klara Inc.

Details

Provenance
allanjudeAuthored on
Parents
rS365701: Makefile.inc1: remove more old stale depend hacks
Branches
Unknown
Tags
Unknown