Re: [Qemu-devel] [PATCH] blk: Add discard=sparse mode

2017-02-27 Thread Samuel Thibault
Hello, Max Reitz, on lun. 27 févr. 2017 17:12:47 +0100, wrote: > > #ifdef CONFIG_FALLOCATE_PUNCH_HOLE > > -if (s->has_discard && s->has_fallocate) { > > +if (s->has_discard && (s->has_fallocate || open_flags & > > BDRV_O_SPARSE)) { > > s->has_fallocate has a meaning. I wouldn't try to

Re: [Qemu-devel] [PATCH] blk: Add discard=sparse mode

2017-02-27 Thread Max Reitz
On 27.02.2017 17:33, Samuel Thibault wrote: > Hello, > > Max Reitz, on lun. 27 févr. 2017 17:12:47 +0100, wrote: >>> #ifdef CONFIG_FALLOCATE_PUNCH_HOLE >>> -if (s->has_discard && s->has_fallocate) { >>> +if (s->has_discard && (s->has_fallocate || open_flags & >>> BDRV_O_SPARSE)) { >> >>

Re: [Qemu-devel] [PATCH] blk: Add discard=sparse mode

2017-02-27 Thread Max Reitz
Hi, On 27.02.2017 01:45, Samuel Thibault wrote: > By default, on discard requests, the posix block backend punches holes but > re-fallocates them to keep the allocated size intact. In some situations > it is however convenient, when using sparse disk images, to see disk image > sizes shrink on

[Qemu-devel] [PATCH] blk: Add discard=sparse mode

2017-02-26 Thread Samuel Thibault
By default, on discard requests, the posix block backend punches holes but re-fallocates them to keep the allocated size intact. In some situations it is however convenient, when using sparse disk images, to see disk image sizes shrink on discard requests. This commit adds a discard=sparse mode