On Wed, Oct 14, 2020 at 10:47:21AM +0200, Klaus Jensen wrote: > On Oct 13 14:06, Keith Busch wrote: > > > If we were going to support it here, wouldn't it make more sense to > > tie it to the filesystem's ability to support fallocate hole punch for > > the backing namespace, and check if the range is allocated with > > SEEK_HOLE? Then you don't even need to track persistent state, and > > we're actually getting the genuine capability. > > > > Yes, this would be optimal, definitely. I think we have to rely on what > we can do with the QEMU block layer, so please see my v2 that uses > bdrv_block_status. I did do something like this initially, but was > unsure if we could live with the fact that block drivers such as qcow2 > cannot honor a discard unless an entire cluster is discard/zeroed. > > But see my commit message, I think we can work with it and still be in > compliance with the spec.
Yes, I think that's better, though I'm not familiar with that particular API. I definitely prefer implementing spec features in useful ways that work with other layers rather than faking it.
