summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorHu Tao <hutao@cn.fujitsu.com>2014-01-21 11:30:02 +0800
committerKevin Wolf <kwolf@redhat.com>2014-01-24 14:33:00 +0100
commit46bae927134468d27f5e2508c3ced67ff58fa45b (patch)
tree3439cd8ae538777408ee56642da1c2af7105aaa9 /block
parent385c04d0b66917457b6a12fc2cfd99a6a40b2d89 (diff)
downloadqemu-46bae927134468d27f5e2508c3ced67ff58fa45b.tar.gz
qemu-46bae927134468d27f5e2508c3ced67ff58fa45b.tar.bz2
qemu-46bae927134468d27f5e2508c3ced67ff58fa45b.zip
qcow2: fix wrong value of L1E_OFFSET_MASK, L2E_OFFSET_MASK and REFT_OFFSET_MASK
Accoring to qcow spec, the offset fields in l1e, l2e and ref table entry start at bit 9. The offset is cluster offset, and the smallest possible cluster size is 512 bytes. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 303eb26629..b5b7d13630 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -340,11 +340,11 @@ typedef enum QCow2MetadataOverlap {
#define QCOW2_OL_ALL \
(QCOW2_OL_CACHED | QCOW2_OL_INACTIVE_L2)
-#define L1E_OFFSET_MASK 0x00ffffffffffff00ULL
-#define L2E_OFFSET_MASK 0x00ffffffffffff00ULL
+#define L1E_OFFSET_MASK 0x00fffffffffffe00ULL
+#define L2E_OFFSET_MASK 0x00fffffffffffe00ULL
#define L2E_COMPRESSED_OFFSET_SIZE_MASK 0x3fffffffffffffffULL
-#define REFT_OFFSET_MASK 0xffffffffffffff00ULL
+#define REFT_OFFSET_MASK 0xfffffffffffffe00ULL
static inline int64_t start_of_cluster(BDRVQcowState *s, int64_t offset)
{