diff mbox series

[v8,2/3] docs: define padding for qcow2 header

Message ID 20191018094758.7124-3-vsementsov@virtuozzo.com
State New
Headers show
Series qcow2: add zstd cluster compression | expand

Commit Message

Vladimir Sementsov-Ogievskiy Oct. 18, 2019, 9:47 a.m. UTC
Header extensions ends are already defined to be multiply of 8. Let's
gently ask for header length to be a multiply of 8 too, when we have
some additional fields. Requiring this may be considered as an
incompatible change, so the padding is optional. Actually, padding is
allowed before this patch (due to definition of additional fields),
the only actual change is "SHOULD" word.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 docs/interop/qcow2.txt | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Eric Blake Oct. 18, 2019, 2:02 p.m. UTC | #1
On 10/18/19 4:47 AM, Vladimir Sementsov-Ogievskiy wrote:
> Header extensions ends are already defined to be multiply of 8. Let's
> gently ask for header length to be a multiply of 8 too, when we have
> some additional fields. Requiring this may be considered as an
> incompatible change, so the padding is optional. Actually, padding is
> allowed before this patch (due to definition of additional fields),
> the only actual change is "SHOULD" word.

Too weak. I've already argued that this should be mandatory, and that we 
are not breaking backwards compatibility, but merely clarifying what has 
already been implicit by the fact that header extensions are required to 
be 8-byte size multiple (which makes no sense unless they are also 
8-byte aligned).

> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>   docs/interop/qcow2.txt | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt
> index 4709f3bb30..b971e59b1a 100644
> --- a/docs/interop/qcow2.txt
> +++ b/docs/interop/qcow2.txt
> @@ -185,6 +185,11 @@ which is covered by @header_length must be zeroed.
>   
>           < ... No additional fields in the header currently ... >
>   
> +Header padding
> +        If @header_length is larger than 104, software SHOULD make it a
> +        multiply of 8, adding zero-padding after additional fields. Still the
> +        padding is optional and may be absent in the image.
> +
>   Directly after the image header, optional sections called header extensions can
>   be stored. Each extension has a structure like the following:
>   
>
Vladimir Sementsov-Ogievskiy Oct. 18, 2019, 2:37 p.m. UTC | #2
18.10.2019 17:02, Eric Blake wrote:
> On 10/18/19 4:47 AM, Vladimir Sementsov-Ogievskiy wrote:
>> Header extensions ends are already defined to be multiply of 8. Let's
>> gently ask for header length to be a multiply of 8 too, when we have
>> some additional fields. Requiring this may be considered as an
>> incompatible change, so the padding is optional. Actually, padding is
>> allowed before this patch (due to definition of additional fields),
>> the only actual change is "SHOULD" word.
> 
> Too weak. I've already argued that this should be mandatory, and that we are not breaking backwards compatibility, but merely clarifying what has already been implicit by the fact that header extensions are required to be 8-byte size multiple (which makes no sense unless they are also 8-byte aligned).

OK

> 
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>>   docs/interop/qcow2.txt | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt
>> index 4709f3bb30..b971e59b1a 100644
>> --- a/docs/interop/qcow2.txt
>> +++ b/docs/interop/qcow2.txt
>> @@ -185,6 +185,11 @@ which is covered by @header_length must be zeroed.
>>           < ... No additional fields in the header currently ... >
>> +Header padding
>> +        If @header_length is larger than 104, software SHOULD make it a
>> +        multiply of 8, adding zero-padding after additional fields. Still the
>> +        padding is optional and may be absent in the image.
>> +
>>   Directly after the image header, optional sections called header extensions can
>>   be stored. Each extension has a structure like the following:
>>
>
diff mbox series

Patch

diff --git a/docs/interop/qcow2.txt b/docs/interop/qcow2.txt
index 4709f3bb30..b971e59b1a 100644
--- a/docs/interop/qcow2.txt
+++ b/docs/interop/qcow2.txt
@@ -185,6 +185,11 @@  which is covered by @header_length must be zeroed.
 
         < ... No additional fields in the header currently ... >
 
+Header padding
+        If @header_length is larger than 104, software SHOULD make it a
+        multiply of 8, adding zero-padding after additional fields. Still the
+        padding is optional and may be absent in the image.
+
 Directly after the image header, optional sections called header extensions can
 be stored. Each extension has a structure like the following: