Re: [Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-17 Thread Kevin Wolf
Am 17.06.2013 um 17:41 hat Stefan Hajnoczi geschrieben: > On Thu, Jun 13, 2013 at 01:47:41PM +0200, Kevin Wolf wrote: > > @@ -532,6 +548,16 @@ static int qcow2_open(BlockDriverState *bs, QDict > > *options, int flags) > > s->use_lazy_refcounts = qemu_opt_get_bool(opts, > > QCOW2_OPT_LAZY_REF

Re: [Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-17 Thread Stefan Hajnoczi
On Thu, Jun 13, 2013 at 01:47:41PM +0200, Kevin Wolf wrote: > @@ -532,6 +548,16 @@ static int qcow2_open(BlockDriverState *bs, QDict > *options, int flags) > s->use_lazy_refcounts = qemu_opt_get_bool(opts, QCOW2_OPT_LAZY_REFCOUNTS, > (s->compatible_features & QCOW2_COMPAT_LAZY_REFCOU

Re: [Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-14 Thread Paolo Bonzini
Il 14/06/2013 10:31, Kevin Wolf ha scritto: >> It looks like QCOW2_OPT_DISCARD_OTHER is a rare case, so I don't mind >> leaving it as default to false. It won't waste more than a few clusters. > > Yes, it's generally relatively rare, like growing L1 or refcount table. > There is one case where it

Re: [Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-14 Thread Kevin Wolf
Am 14.06.2013 um 16:16 hat Paolo Bonzini geschrieben: > Il 14/06/2013 04:31, Kevin Wolf ha scritto: > >>> > > +s->discard_passthrough[QCOW2_DISCARD_NEVER] = false, > >>> > > +s->discard_passthrough[QCOW2_DISCARD_ALWAYS] = true, > >>> > > +s->discard_passthrough[QCOW2_DISCARD_REQUEST] =

Re: [Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-14 Thread Paolo Bonzini
Il 14/06/2013 04:31, Kevin Wolf ha scritto: >>> > > +s->discard_passthrough[QCOW2_DISCARD_NEVER] = false, >>> > > +s->discard_passthrough[QCOW2_DISCARD_ALWAYS] = true, >>> > > +s->discard_passthrough[QCOW2_DISCARD_REQUEST] = >>> > > +qemu_opt_get_bool(opts, QCOW2_OPT_DISCARD_REQ

Re: [Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-14 Thread Kevin Wolf
Am 14.06.2013 um 00:10 hat Paolo Bonzini geschrieben: > Il 13/06/2013 07:47, Kevin Wolf ha scritto: > > +s->discard_passthrough[QCOW2_DISCARD_NEVER] = false, > > +s->discard_passthrough[QCOW2_DISCARD_ALWAYS] = true, > > +s->discard_passthrough[QCOW2_DISCARD_REQUEST] = > > +qemu_

Re: [Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-13 Thread Paolo Bonzini
Il 13/06/2013 07:47, Kevin Wolf ha scritto: > +s->discard_passthrough[QCOW2_DISCARD_NEVER] = false, > +s->discard_passthrough[QCOW2_DISCARD_ALWAYS] = true, > +s->discard_passthrough[QCOW2_DISCARD_REQUEST] = > +qemu_opt_get_bool(opts, QCOW2_OPT_DISCARD_REQUEST, > +

[Qemu-devel] [PATCH 3/5] qcow2: Options to enable discard for freed clusters

2013-06-13 Thread Kevin Wolf
Deleted snapshots are discarded in the image file by default, discard requests take their default from the -drive discard=... option and other places that free clusters must always be enabled explicitly. Signed-off-by: Kevin Wolf --- block/qcow2-refcount.c | 5 + block/qcow2.c | 26