[PATCH v8 2/3] docs: define padding for qcow2 header
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 --- 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: -- 2.21.0
Re: [PATCH v8 2/3] docs: define padding for qcow2 header
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 --- 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: -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
Re: [PATCH v8 2/3] docs: define padding for qcow2 header
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 >> --- >> 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: >> > -- Best regards, Vladimir