[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] qcow2: Clarify that compressed cluster offset r

From: Max Reitz
Subject: Re: [Qemu-block] [PATCH] qcow2: Clarify that compressed cluster offset requires shift
Date: Mon, 29 Feb 2016 17:07:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 29.02.2016 17:06, Eric Blake wrote:
> On 02/29/2016 08:46 AM, Max Reitz wrote:
>>>>  Compressed Clusters Descriptor (x = 62 - (cluster_bits - 8)):
>>>> -    Bit  0 -  x:    Host cluster offset. This is usually _not_ aligned to 
>>>> a
>>>> -                    cluster boundary!
>>>> +    Bit  0 -  x:    Bits 9-(x+9) of host cluster offset. This is
>>> I'd rather use one of "9..(x+9)", "[9, x+9]", "9 - (x+9)", "9—(x+9)" in
>>> order to clarify that this is not a minus but a range.
>> ...unless, of course, this is actually a byte offset, which it seems to
>> be, judging from qcow2_get_cluster_offset() (and
>> qcow2_decompress_cluster(), as Kevin said on IRC).
> Hmm, then I may be totally wrong. (Serves me right for trying to write a
> spec patch without testing actual behavior).
> At the least, we may want to say that things are usually not aligned to
> even a _sector_ boundary (not just cluster boundary), and also clarify
> whether the sector length is truncated or rounded up (zlib doesn't care
> about trailing garbage during decompression, but you DO need to know how
> many sectors to read to ensure that you are supplying zlib with trailing
> garbage, rather than a truncated stream).

Yes, I agree.


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]