[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 08/16] qcow2: Ignore reserved bits in refcount t
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [RFC PATCH 08/16] qcow2: Ignore reserved bits in refcount table entries |
Date: |
Tue, 27 Mar 2012 17:03:27 +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 bad5448..102578e 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -174,6 +174,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] [RFC PATCH 00/16] qcow2: Basic version 3 support, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 08/16] qcow2: Ignore reserved bits in refcount table entries,
Kevin Wolf <=
- [Qemu-devel] [RFC PATCH 03/16] qcow2: Ignore reserved bits in count_contiguous_clusters(), Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 05/16] qcow2: Ignore reserved bits in L1/L2 entries, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 12/16] qcow2: Support for feature table header extension, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 01/16] Specification for qcow2 version 3, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 04/16] qcow2: Fail write_compressed when overwriting data, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 06/16] qcow2: Refactor qcow2_free_any_clusters, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 09/16] qcow2: Ignore reserved bits in check_refcounts, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 02/16] qcow2: Ignore reserved bits in get_cluster_offset, Kevin Wolf, 2012/03/27
- [Qemu-devel] [RFC PATCH 14/16] qemu-iotests: Test COW with zero clusters, Kevin Wolf, 2012/03/27