Il 20/02/2013 15:13, Kevin Wolf ha scritto: > On Fri, Feb 08, 2013 at 02:06:14PM +0100, Paolo Bonzini wrote: >> Because discard is now a host parameter, we can always fake it as enabled >> in the guest. This is an extension of the current choice to ignore >> "not supported" errors from the host when discard_granularity is set >> to nonzero. >> >> The default granularity is set to the logical block size or 4k, whichever >> is largest, because cluster sizes below 4k are rarely used and 4K is a >> typical block size for files. >> >> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > > I wonder if it would make sense to default to 64k so that a qcow2 image > with default options can make use of it. On the other hand, it might > just mean that discard requests are already dropped in the guest kernel > instead of qemu, then we don't really win much.
In theory it might provide better alignment, but only if we set a "maximum unmap length" in the block limits VPD page. Since we don't, there should be no difference. Luckily this is just a guest visible parameter and can be versioned in the machine types, so it's not "another cache=writethrough" that took years to correct. Paolo