[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/61] qcow2: Make overlap check mask variable
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 27/61] qcow2: Make overlap check mask variable |
Date: |
Fri, 11 Oct 2013 17:05:17 +0200 |
From: Max Reitz <address@hidden>
Replace the QCOW2_OL_DEFAULT macro by a variable overlap_check in
BDRVQcowState.
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-refcount.c | 2 +-
block/qcow2.c | 2 ++
block/qcow2.h | 5 ++---
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 988644a..1ff43d0 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -1649,7 +1649,7 @@ int qcow2_check_metadata_overlap(BlockDriverState *bs,
int ign, int64_t offset,
int64_t size)
{
BDRVQcowState *s = bs->opaque;
- int chk = QCOW2_OL_DEFAULT & ~ign;
+ int chk = s->overlap_check & ~ign;
int i, j;
if (!size) {
diff --git a/block/qcow2.c b/block/qcow2.c
index c461471..46acca7 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -631,6 +631,8 @@ static int qcow2_open(BlockDriverState *bs, QDict *options,
int flags,
s->discard_passthrough[QCOW2_DISCARD_OTHER] =
qemu_opt_get_bool(opts, QCOW2_OPT_DISCARD_OTHER, false);
+ s->overlap_check = QCOW2_OL_CACHED;
+
qemu_opts_del(opts);
if (s->use_lazy_refcounts && s->qcow_version < 3) {
diff --git a/block/qcow2.h b/block/qcow2.h
index 8692011..6c85bb9 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -203,6 +203,8 @@ typedef struct BDRVQcowState {
bool discard_passthrough[QCOW2_DISCARD_MAX];
+ int overlap_check; /* bitmask of Qcow2MetadataOverlap values */
+
uint64_t incompatible_features;
uint64_t compatible_features;
uint64_t autoclear_features;
@@ -321,9 +323,6 @@ typedef enum QCow2MetadataOverlap {
QCOW2_OL_REFCOUNT_TABLE | QCOW2_OL_REFCOUNT_BLOCK | \
QCOW2_OL_SNAPSHOT_TABLE | QCOW2_OL_INACTIVE_L1)
-/* The default checks to perform */
-#define QCOW2_OL_DEFAULT QCOW2_OL_CACHED
-
#define L1E_OFFSET_MASK 0x00ffffffffffff00ULL
#define L2E_OFFSET_MASK 0x00ffffffffffff00ULL
#define L2E_COMPRESSED_OFFSET_SIZE_MASK 0x3fffffffffffffffULL
--
1.8.1.4
- [Qemu-devel] [PULL 15/61] qcow2: Assert against snapshot name/ID overflow, (continued)
- [Qemu-devel] [PULL 15/61] qcow2: Assert against snapshot name/ID overflow, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 18/61] qemu-iotests: Discard preallocated zero clusters, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 19/61] ahci: set ahci mode on reset, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 21/61] qcow2: Add missing space in error message, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 20/61] block: qemu-iotests for vhdx, read sample dynamic image, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 22/61] qcow2: Remove wrong metadata overlap check, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 23/61] qcow2: Fix snapshot restoration in snapshot_create, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 24/61] qcow2: Use better type for numerical snapshot ID, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 25/61] block: Improve driver whitelist checks, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 26/61] qcow2: Use negated overflow check mask, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 27/61] qcow2: Make overlap check mask variable,
Kevin Wolf <=
- [Qemu-devel] [PULL 28/61] qcow2: Add overlap-check options, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 29/61] qcow2: Array assigning options to OL check bits, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 31/61] qcow2: Evaluate overlap check options, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 30/61] qcow2: Add more overlap check bitmask macros, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 32/61] block/raw_bsd: Employ error parameter, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 33/61] block/raw-win32: Employ error parameter, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 34/61] blkdebug: Employ error parameter, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 35/61] blkverify: Employ error parameter, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 36/61] qemu-iotests: move blank lines of output in case 059, Kevin Wolf, 2013/10/11
- [Qemu-devel] [PULL 37/61] block/raw-posix: Employ error parameter, Kevin Wolf, 2013/10/11