Skip to contentSkip to conversation

qcow2: Explicit mention of padding bytes

PATCH In review Eric Blake 2 participants 4 messages Apr 3, 2020 – Apr 6, 2020

lore
Share & tools
lore

Eric Blake

author
#0 lore raw

PATCH v2 1/1 qcow2: Explicit mention of padding bytes

Although we already covered the need for padding bytes with our changes in commit 3ae3fcfa, commit 66fcbca5 just added one byte and relied on the rest of the text for implicitly covering 7 padding bytes. For consistency with other parts of the header (such as the header extension format listing padding from n - m, or the snapshot table entry mentioning variable padding), we might as well call out the remaining 7 bytes as padding until such time (as any) as they gain another meaning.

---

v2: Call out explicit byte range rather than '105 - m' [Max]

Safe for 5.0 as it is just a doc fix, but only if we actually want it.

 docs/interop/qcow2.txt | 1 +
 1 file changed, 1 insertion(+)
docs/interop/qcow2.txt +1 -0
index 640e0eca4000..80728bc2008d 100644
@@ -210,3 +210,4 @@ version 2.
                     Available compression type values:
                         0: zlib <https://www.zlib.net/>
 
+        105 - 111:  Padding, leave as zero.

=== Header padding ===

Signature · 1 line
2.26.0.rc2
#1 lore raw
Quoted 25 lines · Eric Blake

Although we already covered the need for padding bytes with our changes in commit 3ae3fcfa, commit 66fcbca5 just added one byte and relied on the rest of the text for implicitly covering 7 padding bytes. For consistency with other parts of the header (such as the header extension format listing padding from n - m, or the snapshot table entry mentioning variable padding), we might as well call out the remaining 7 bytes as padding until such time (as any) as they gain another meaning.

---

v2: Call out explicit byte range rather than '105 - m' [Max]

Safe for 5.0 as it is just a doc fix, but only if we actually want it.

  docs/interop/qcow2.txt | 1 +
  1 file changed, 1 insertion(+)
docs/interop/qcow2.txt +0 -0
index 640e0eca4000..80728bc2008d 100644

docs/interop/qcow2.txt version 2. · line 213

Quoted 4 lines
docs/interop/qcow2.txt +1 -0
@@ -210,3 +210,4 @@ version 2.
                      Available compression type values:
                          0: zlib <https://www.zlib.net/>
 
+        105 - 111:  Padding, leave as zero.

Looking on this in separate, I'd make a software which will zero this padding unconditionally. However, if it's an existing image which we just open, we should keep the content we read.. On the other hand, of course, if read the whole spec, everything is clear.

Signature · 2 lines
Best regards,
Vladimir
author
#2 lore raw
Quoted 28 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines · Eric Blake

Although we already covered the need for padding bytes with our changes in commit 3ae3fcfa, commit 66fcbca5 just added one byte and relied on the rest of the text for implicitly covering 7 padding bytes.  For consistency with other parts of the header (such as the header extension format listing padding from n - m, or the snapshot table entry mentioning variable padding), we might as well call out the remaining 7 bytes as padding until such time (as any) as they gain another meaning.

---

v2: Call out explicit byte range rather than '105 - m' [Max]

Safe for 5.0 as it is just a doc fix, but only if we actually want it.

  docs/interop/qcow2.txt | 1 +

  1 file changed, 1 insertion(+)
docs/interop/qcow2.txt +0 -0
index 640e0eca4000..80728bc2008d 100644
@@ -210,3 +210,4 @@ version 2.

                      Available compression type values:
                          0: zlib <https://www.zlib.net/>

Quoted 4 lines
Quoted 2 lines

+        105 - 111:  Padding, leave as zero.

Looking on this in separate, I'd make a software which will zero this padding unconditionally. However, if it's an existing image which we just open, we should keep the content we read.. On the other hand, of course, if read the whole spec, everything is clear.

Maybe:
105 - 111: Padding, contents defined below

rather than an explicit mention of setting to 0?

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#3 lore raw
Quoted 29 lines · Eric Blake
Quoted 28 lines · Vladimir Sementsov-Ogievskiy
Quoted 27 lines · Eric Blake

Although we already covered the need for padding bytes with our changes in commit 3ae3fcfa, commit 66fcbca5 just added one byte and relied on the rest of the text for implicitly covering 7 padding bytes.  For consistency with other parts of the header (such as the header extension format listing padding from n - m, or the snapshot table entry mentioning variable padding), we might as well call out the remaining 7 bytes as padding until such time (as any) as they gain another meaning.

---

v2: Call out explicit byte range rather than '105 - m' [Max]

Safe for 5.0 as it is just a doc fix, but only if we actually want it.

  docs/interop/qcow2.txt | 1 +

  1 file changed, 1 insertion(+)
docs/interop/qcow2.txt +0 -0
index 640e0eca4000..80728bc2008d 100644
@@ -210,3 +210,4 @@ version 2.

                      Available compression type values:
                          0: zlib <https://www.zlib.net/>

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

+        105 - 111:  Padding, leave as zero.

Looking on this in separate, I'd make a software which will zero this padding unconditionally. However, if it's an existing image which we just open, we should keep the content we read.. On the other hand, of course, if read the whole spec, everything is clear.

Maybe:
  105 - 111: Padding, contents defined below

Works for me, no objections)

Quoted 3 lines

rather than an explicit mention of setting to 0?

Signature · 2 lines
Best regards,
Vladimir