[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/19] qcow2: Ignore reserved bits in refcount table
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 09/19] qcow2: Ignore reserved bits in refcount table entries |
Date: |
Thu, 12 Apr 2012 17:01:10 +0200 |
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-refcount.c | 2 +-
block/qcow2.h | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 2ec3aa7..50bf44e 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -167,7 +167,7 @@ static int alloc_refcount_block(BlockDriverState *bs,
if (refcount_table_index < s->refcount_table_size) {
uint64_t refcount_block_offset =
- s->refcount_table[refcount_table_index];
+ s->refcount_table[refcount_table_index] & REFT_OFFSET_MASK;
/* If it's already there, we're done */
if (refcount_block_offset) {
diff --git a/block/qcow2.h b/block/qcow2.h
index a22d7fa..291309a 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -175,6 +175,8 @@ enum {
#define L2E_OFFSET_MASK 0x00ffffffffffff00ULL
#define L2E_COMPRESSED_OFFSET_SIZE_MASK 0x3fffffffffffffffULL
+#define REFT_OFFSET_MASK 0xffffffffffffff00ULL
+
static inline int size_to_clusters(BDRVQcowState *s, int64_t size)
{
return (size + (s->cluster_size - 1)) >> s->cluster_bits;
--
1.7.6.5
- [Qemu-devel] [PATCH 00/19] qcow2: Add basic version 3 support, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 01/19] Specification for qcow2 version 3, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 05/19] qcow2: Fail write_compressed when overwriting data, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 04/19] qcow2: Ignore reserved bits in count_contiguous_clusters(), Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 03/19] qcow2: Ignore reserved bits in get_cluster_offset, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 02/19] qcow2: Save disk size in snapshot header, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 09/19] qcow2: Ignore reserved bits in refcount table entries,
Kevin Wolf <=
- [Qemu-devel] [PATCH 07/19] qcow2: Refactor qcow2_free_any_clusters, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 10/19] qcow2: Ignore reserved bits in check_refcounts, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 18/19] [RFC] Possible qcow2 specification extensions, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 06/19] qcow2: Ignore reserved bits in L1/L2 entries, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 11/19] qcow2: Version 3 images, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 08/19] qcow2: Simplify count_cow_clusters, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 12/19] qcow2: Support reading zero clusters, Kevin Wolf, 2012/04/12
- [Qemu-devel] [PATCH 14/19] qemu-iotests: add a simple test for write_zeroes, Kevin Wolf, 2012/04/12