Re: [Qemu-devel] Using TRIM to shrink qcow2 images

2013-10-04 Thread Paolo Bonzini
Il 04/10/2013 09:07, Alexey Kardashevskiy ha scritto: > On 10/04/2013 05:05 PM, Paolo Bonzini wrote: >> Il 04/10/2013 08:22, Alexey Kardashevskiy ha scritto: >>> >>> btw I tried "discard=on" as you described (with if=virtio) and received >>> an error: >>> [root@localhost ~]# fstrim -v / >>> fstrim:

Re: [Qemu-devel] Using TRIM to shrink qcow2 images

2013-10-04 Thread Alexey Kardashevskiy
On 10/04/2013 05:05 PM, Paolo Bonzini wrote: > Il 04/10/2013 08:22, Alexey Kardashevskiy ha scritto: >> >> btw I tried "discard=on" as you described (with if=virtio) and received >> an error: >> [root@localhost ~]# fstrim -v / >> fstrim: /: FITRIM ioctl failed: Operation not supported >> >> In my c

Re: [Qemu-devel] Using TRIM to shrink qcow2 images

2013-10-04 Thread Paolo Bonzini
Il 04/10/2013 08:22, Alexey Kardashevskiy ha scritto: > > btw I tried "discard=on" as you described (with if=virtio) and received > an error: > [root@localhost ~]# fstrim -v / > fstrim: /: FITRIM ioctl failed: Operation not supported > > In my case if=virtio means virtio-blk. If I use virtio-scsi

Re: [Qemu-devel] Using TRIM to shrink qcow2 images

2013-10-03 Thread Alexey Kardashevskiy
Hi Paolo! On Thu, Aug 8, 2013 at 10:00 PM, Paolo Bonzini wrote: > On 08/08/2013 12:34 PM, Ralf Ramsauer wrote: > >> Hi, >> >> QCOW2 uses a similar idea like file holes (sparse files) on filesystems >> [1]. >> RAW Images also may use file holes. >> >> If qemu would support TRIM, then the guest

Re: [Qemu-devel] Using TRIM to shrink qcow2 images

2013-08-08 Thread Paolo Bonzini
On 08/08/2013 12:34 PM, Ralf Ramsauer wrote: Hi, QCOW2 uses a similar idea like file holes (sparse files) on filesystems [1]. RAW Images also may use file holes. If qemu would support TRIM, then the guest could easily discard and zero all unused blocks. QEMU supports trim. 1.5 supports it wi

Re: [Qemu-devel] Using TRIM to shrink qcow2 images

2013-08-08 Thread François Revol
On 08/08/2013 12:34, Ralf Ramsauer wrote: > Hi, > > QCOW2 uses a similar idea like file holes (sparse files) on filesystems [1]. > RAW Images also may use file holes. > > If qemu would support TRIM, then the guest could easily discard and zero > all unused blocks. > The host system could detect a

[Qemu-devel] Using TRIM to shrink qcow2 images

2013-08-08 Thread Ralf Ramsauer
Hi, QCOW2 uses a similar idea like file holes (sparse files) on filesystems [1]. RAW Images also may use file holes. If qemu would support TRIM, then the guest could easily discard and zero all unused blocks. The host system could detect all unused blocks in a (e.g.) qcow2 image and shrink it dow