Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-08 Thread Paolo Bonzini
Il 08/01/2014 23:53, Richard W.M. Jones ha scritto: > On Wed, Jan 08, 2014 at 11:45:39PM +0100, Paolo Bonzini wrote: >> Il 08/01/2014 23:24, Richard W.M. Jones ha scritto: >>> It's extremely difficult to know when it's safe to add this parameter. >>> Qemu gives no indication of when using discard=.

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-08 Thread Richard W.M. Jones
On Wed, Jan 08, 2014 at 11:45:39PM +0100, Paolo Bonzini wrote: > Il 08/01/2014 23:24, Richard W.M. Jones ha scritto: > > It's extremely difficult to know when it's safe to add this parameter. > > Qemu gives no indication of when using discard=.. is safe (ie. won't > > cause qemu to fail to start up

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-08 Thread Paolo Bonzini
Il 08/01/2014 23:24, Richard W.M. Jones ha scritto: > On Wed, Jan 08, 2014 at 11:11:35PM +0100, Paolo Bonzini wrote: >> Is guestfish using "discard=on"? > > No. > > Adding the discard=on parameter does indeed fix this: > > 13M/tmp/test1 > 17M/tmp/test2 > > However why isn't this the def

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-08 Thread Richard W.M. Jones
On Wed, Jan 08, 2014 at 11:11:35PM +0100, Paolo Bonzini wrote: > Is guestfish using "discard=on"? No. Adding the discard=on parameter does indeed fix this: 13M/tmp/test1 17M/tmp/test2 However why isn't this the default? Is there a case where discard=on would be undesirable? It's extre

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-08 Thread Paolo Bonzini
Il 07/01/2014 22:22, Richard W.M. Jones ha scritto: > On Tue, Jan 07, 2014 at 09:48:17PM +0100, Paolo Bonzini wrote: >> Il 07/01/2014 21:27, Richard W.M. Jones ha scritto: >>> Not much more what I said in the original email (especially see the >>> attached script which you can download from the bot

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-07 Thread Richard W.M. Jones
On Tue, Jan 07, 2014 at 09:48:17PM +0100, Paolo Bonzini wrote: > Il 07/01/2014 21:27, Richard W.M. Jones ha scritto: > > Not much more what I said in the original email (especially see the > > attached script which you can download from the bottom of this page: > > https://lists.gnu.org/archive/htm

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-07 Thread Richard W.M. Jones
Using qcow2 format, it also doesn't appear to work: $ /tmp/sparsetest.sh Formatting '/tmp/test1', fmt=qcow2 size=104857600 encryption=off cluster_size=65536 lazy_refcounts=off Formatting '/tmp/test2', fmt=qcow2 size=104857600 encryption=off cluster_size=65536 lazy_refcounts=off 136K /tm

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-07 Thread Paolo Bonzini
Il 07/01/2014 21:27, Richard W.M. Jones ha scritto: > Not much more what I said in the original email (especially see the > attached script which you can download from the bottom of this page: > https://lists.gnu.org/archive/html/qemu-devel/2014-01/msg00084.html ) > > Basically it tries to dd /dev

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-07 Thread Richard W.M. Jones
On Tue, Jan 07, 2014 at 03:48:54PM +0100, Paolo Bonzini wrote: > Il 02/01/2014 17:15, Richard W.M. Jones ha scritto: > > > > My (possibly weak) understanding of the upstream qemu code is that > > unmap/discard/trim is not supported in qcow2. It is only supported in > > raw files when using a POSI

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-07 Thread Paolo Bonzini
Il 02/01/2014 17:15, Richard W.M. Jones ha scritto: > > My (possibly weak) understanding of the upstream qemu code is that > unmap/discard/trim is not supported in qcow2. It is only supported in > raw files when using a POSIX-like host OS which has either of: > > - block devices supporting BLKD

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-05 Thread Stefan Hajnoczi
On Mon, Dec 30, 2013 at 07:58:29PM +0800, Teng-Feng Yang wrote: > I have been studying QCOW2 file format for a couple of days, and I am > a little bit confused about whether QCOW2 supports UNMAP or not. Discard is an area that has seen a lot of development activity over the past year or two. That

Re: [Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2014-01-02 Thread Richard W.M. Jones
On Mon, Dec 30, 2013 at 07:58:29PM +0800, Teng-Feng Yang wrote: > I have been studying QCOW2 file format for a couple of days, and I am > a little bit confused about whether QCOW2 supports UNMAP or not. > As I surf through internet, some mailing list discussion had mentioned > that qemu-nbd and nbd

[Qemu-devel] TRIM/DISCARD/UNMAP support on qemu-nbd

2013-12-30 Thread Teng-Feng Yang
Hi folks, I have been studying QCOW2 file format for a couple of days, and I am a little bit confused about whether QCOW2 supports UNMAP or not. As I surf through internet, some mailing list discussion had mentioned that qemu-nbd and nbd module both support UNMAP command. So I follow the steps bel