On 07/20/2017 11:26 AM, Peter Lieven wrote: >> I haven't yet checked your code implementation to see where you are >> setting window sizes, to know if window size is something that should be >> a tunable in the file format. >> > You don't have to know the window size that was used. The docs of zlib > > just say, that the windowSize specified at inflate must be greater or equal > > to the one used at deflate. So if we change the code to use 15 we can safely > > decompress old clusters that where compressed with 12.
Then you DO have to know the window size. If I write my own qcow2 parser, and don't know what size you picked on compression, then how do I know that the size I pick is >= your size during my decompression? Even if you DON'T want size to be a tunable (and I'm on the fence on that one), you STILL need the spec to state that for maximum compatibility, when the incompatible feature is off, implementations MUST use window size 12 for compression; and that when the compression extension is used, implementations MUST use window size 15. Or, by having window size be a tunable in the extension header allows implementations to record window size, then you allow implemenations to explicitly KNOW what window size they must meet or exceed. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature