Il 10/03/2014 17:14, Richard W.M. Jones ha scritto:
On Mon, Mar 10, 2014 at 04:11:20PM +0000, Richard W.M. Jones wrote:
Guest:
 - guest kernel: 3.13.4-200.fc20.x86_64
 - ext4 guest filesystem
 - fstrim from util-linux 2.24.1
 - cat /sys/block/sda/device/scsi_disk/*/provisioning_mode
   unmap

I noticed that I wasn't mounting the guest filesystem with '-o discard'.
However it still doesn't work even after adding this option.

Works here:

$ qemu-system-x86_64 -drive discard=unmap,file=$HOME/jeos-19-64.qcow2,id=ff,if=none -device virtio-scsi-pci -device scsi-disk,drive=ff -vnc :0 --enable-kvm

Before test:
$ du -h jeos-19-64.qcow2
1,6G    jeos-19-64.qcow2

After "dd if=/dev/zero of=foo bs=1M count=300":
$ du -h jeos-19-64.qcow2
1,8G    jeos-19-64.qcow2

After "rm foo; fstrim -v /":
$ du -h jeos-19-64.qcow2
1,4G    jeos-19-64.qcow2

I also set a breakpoint on fallocate64, and it was called.

Paolo

Reply via email to