Skip to contentSkip to conversation

docs/specs/qcow2.txt: fix incorrect bits of offsets in entries

PATCH Applied Hu Tao 3 participants 4 messages Dec 30, 2013 – Jan 21, 2014

lore
Share & tools
lore

Hu Tao

author
#0 lore raw

PATCH v2 1/1 docs/specs/qcow2.txt: fix incorrect bits of offsets in entries

Fix incorrect bits of offsets in refcount table entry, l1 table entry and l2 table entry. See REFT_OFFSET_MASK, L1E_OFFSET_MASK and L2E_OFFSET_MASK.

Fix a typo while at the file.

---

v2: update comments as well.

 docs/specs/qcow2.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
docs/specs/qcow2.txt +7 -7
index f19536a..0abf196 100644
@@ -192,9 +192,9 @@ as follows:
 
 Refcount table entry:
 
-    Bit  0 -  8:    Reserved (set to 0)
+    Bit  0 -  7:    Reserved (set to 0)
 
-         9 - 63:    Bits 9-63 of the offset into the image file at which the
+         8 - 63:    Bits 8-63 of the offset into the image file at which the
                     refcount block starts. Must be aligned to a cluster
                     boundary.
 
@@ -218,7 +218,7 @@ The L1 table has a variable size (stored in the header) and may use multiple
 clusters, however it must be contiguous in the image file. L2 tables are
 exactly one cluster in size.
 
-Given a offset into the virtual disk, the offset into the image file can be
+Given an offset into the virtual disk, the offset into the image file can be
 obtained as follows:
 
     l2_entries = (cluster_size / sizeof(uint64_t))
@@ -233,9 +233,9 @@ obtained as follows:
 
 L1 table entry:
 
-    Bit  0 -  8:    Reserved (set to 0)
+    Bit  0 -  7:    Reserved (set to 0)
 
-         9 - 55:    Bits 9-55 of the offset into the image file at which the L2
+         8 - 55:    Bits 8-55 of the offset into the image file at which the L2
                     table starts. Must be aligned to a cluster boundary. If the
                     offset is 0, the L2 table and all clusters described by this
                     L2 table are unallocated.
@@ -268,9 +268,9 @@ Standard Cluster Descriptor:
 
                     With version 2, this is always 0.
 
-         1 -  8:    Reserved (set to 0)
+         1 -  7:    Reserved (set to 0)
 
-         9 - 55:    Bits 9-55 of host cluster offset. Must be aligned to a
+         8 - 55:    Bits 8-55 of host cluster offset. Must be aligned to a
                     cluster boundary. If the offset is 0, the cluster is
                     unallocated.
 
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 6 lines · Hu Tao

Fix incorrect bits of offsets in refcount table entry, l1 table entry and l2 table entry. See REFT_OFFSET_MASK, L1E_OFFSET_MASK and L2E_OFFSET_MASK.

Fix a typo while at the file.

Quoted 7 lines

---

v2: update comments as well.

 docs/specs/qcow2.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

#2 lore raw

Am 17.01.2014 um 08:40 hat Stefan Hajnoczi geschrieben:

Quoted 10 lines · Hu Tao
Quoted 9 lines

Fix incorrect bits of offsets in refcount table entry, l1 table entry and l2 table entry. See REFT_OFFSET_MASK, L1E_OFFSET_MASK and L2E_OFFSET_MASK.

Fix a typo while at the file.

---

Quoted 7 lines
Quoted 4 lines

v2: update comments as well.

 docs/specs/qcow2.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

This patch is wrong. It's the qcow2.h #defines that need to be fixed, not the spec. The smallest possible cluster size is 512 bytes, i.e. nine zero bits at the end, not just eight.

Kevin

author
#3 lore raw
Quoted 16 lines · Kevin Wolf

Am 17.01.2014 um 08:40 hat Stefan Hajnoczi geschrieben:

Quoted 15 lines · Hu Tao
Quoted 13 lines

Fix incorrect bits of offsets in refcount table entry, l1 table entry and l2 table entry. See REFT_OFFSET_MASK, L1E_OFFSET_MASK and L2E_OFFSET_MASK.

Fix a typo while at the file.

---

v2: update comments as well.

 docs/specs/qcow2.txt | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Quoted 6 lines
Quoted 2 lines

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

This patch is wrong. It's the qcow2.h #defines that need to be fixed, not the spec. The smallest possible cluster size is 512 bytes, i.e. nine zero bits at the end, not just eight.

You're right. Thanks to bit 8 in these entries are reserved as zero, we're not running into problem with wrong masks.