Virtio-blk does not support TRIM
Bug #1523246 reported by
David Manouchehri
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
When model=virtio is used, TRIM is not supported.
# mount -o discard /dev/vda4 /mnt
# mount | tail -1
/dev/vda4 on /mnt type fuseblk (rw,nosuid,
# fstrim /mnt/
fstrim: /mnt/: the discard operation is not supported
Booting without model=virtio allows using TRIM (in Windows as well).
Full QEMU line:
qemu-system-x86_64 -enable-kvm -cpu host -bios /usr/share/
Changed in qemu: | |
status: | New → Confirmed |
importance: | Undecided → Wishlist |
summary: |
- Cannot TRIM with VirtIO + VirtIO does not support TRIM |
summary: |
- VirtIO does not support TRIM + Virtio-blk does not support TRIM |
Changed in qemu: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Ideally there should be a warning if a user gives discard=unmap and isn't using the SCSI bus. Using the following options allows the guest to detect the drive as a thinly provisioned drive.
-drive discard= unmap,detect- zeroes= unmap,cache= none,file= vms/win10. hd.img. vmdk,format= vmdk,if= none,id= hd -device virtio- scsi-pci, id=scsi -device scsi-hd,drive=hd