[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 29/38] qcow2: Ignore reserved bits in refcount table
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 29/38] qcow2: Ignore reserved bits in refcount table entries |
Date: |
Fri, 20 Apr 2012 19:01:35 +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 909d615..e0854dc 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 27/38] qcow2: Refactor qcow2_free_any_clusters, (continued)
- [Qemu-devel] [PATCH 27/38] qcow2: Refactor qcow2_free_any_clusters, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 26/38] qcow2: Ignore reserved bits in L1/L2 entries, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 23/38] qcow2: Ignore reserved bits in get_cluster_offset, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 31/38] qcow2: Version 3 images, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 24/38] qcow2: Ignore reserved bits in count_contiguous_clusters(), Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 28/38] qcow2: Simplify count_cow_clusters, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 21/38] Specification for qcow2 version 3, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 32/38] qcow2: Support reading zero clusters, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 33/38] qcow2: Support for feature table header extension, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 38/38] qemu-iotests: Fix test 031 for qcow2 v3 support, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 29/38] qcow2: Ignore reserved bits in refcount table entries,
Kevin Wolf <=
- [Qemu-devel] [PATCH 36/38] qcow2: Zero write support, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 34/38] qemu-iotests: add a simple test for write_zeroes, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 37/38] qemu-iotests: Add -o and make v3 the default for qcow2, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 30/38] qcow2: Ignore reserved bits in check_refcounts, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 35/38] qemu-iotests: Test backing file COW with zero clusters, Kevin Wolf, 2012/04/20