qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Trying to get fstrim / discard=unmap to work


From: Paolo Bonzini
Subject: Re: [Qemu-devel] Trying to get fstrim / discard=unmap to work
Date: Mon, 10 Mar 2014 17:57:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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

[Prev in Thread] Current Thread [Next in Thread]