aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@amazon.com>2013-10-11 09:29:58 -0700
committerAnthony Liguori <aliguori@amazon.com>2013-10-11 09:29:58 -0700
commit33c6cae44eccea5e627c2dc5cbf31456db90fc38 (patch)
tree26f994c9f78144b2a6f12da686a2235d0df1dd21 /block/qcow2.h
parent39c153b80f890dc5f02465dc59992e195abd5f40 (diff)
parent34eeb82de65ce9f83081a3357b0afe80a6a1d86a (diff)
Merge remote-tracking branch 'kwolf/for-anthony' into staging
# By Max Reitz (30) and others # Via Kevin Wolf * kwolf/for-anthony: (61 commits) qemu-iotests: Add test for inactive L2 overlap qemu-io: Let "open" pass options to block driver vmdk: Fix vmdk_parse_extents blockdev: blockdev_init() error conversion blockdev: Don't disable COR automatically with blockdev-add blockdev: Remove 'media' parameter from blockdev_init() qemu-iotests: Check autodel behaviour for device_del blockdev: Remove IF_* check for read-only blockdev_init blockdev: Move virtio-blk device creation to drive_init blockdev: Move bus/unit/index processing to drive_init blockdev: Move parsing of 'boot' option to drive_init blockdev: Moving parsing of geometry options to drive_init blockdev: Move parsing of 'if' option to drive_init blockdev: Move parsing of 'media' option to drive_init blockdev: Pass QDict to blockdev_init() blockdev: Separate ID generation from DriveInfo creation blockdev: 'blockdev-add' QMP command blockdev: Introduce DriveInfo.enable_auto_del qapi-types/visit.py: Inheritance for structs qapi-types/visit.py: Pass whole expr dict for structs ... Message-id: 1381503951-27985-1-git-send-email-kwolf@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 455e38de64..922e19062a 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -63,6 +63,15 @@
#define QCOW2_OPT_DISCARD_REQUEST "pass-discard-request"
#define QCOW2_OPT_DISCARD_SNAPSHOT "pass-discard-snapshot"
#define QCOW2_OPT_DISCARD_OTHER "pass-discard-other"
+#define QCOW2_OPT_OVERLAP "overlap-check"
+#define QCOW2_OPT_OVERLAP_MAIN_HEADER "overlap-check.main-header"
+#define QCOW2_OPT_OVERLAP_ACTIVE_L1 "overlap-check.active-l1"
+#define QCOW2_OPT_OVERLAP_ACTIVE_L2 "overlap-check.active-l2"
+#define QCOW2_OPT_OVERLAP_REFCOUNT_TABLE "overlap-check.refcount-table"
+#define QCOW2_OPT_OVERLAP_REFCOUNT_BLOCK "overlap-check.refcount-block"
+#define QCOW2_OPT_OVERLAP_SNAPSHOT_TABLE "overlap-check.snapshot-table"
+#define QCOW2_OPT_OVERLAP_INACTIVE_L1 "overlap-check.inactive-l1"
+#define QCOW2_OPT_OVERLAP_INACTIVE_L2 "overlap-check.inactive-l2"
typedef struct QCowHeader {
uint32_t magic;
@@ -203,6 +212,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;
@@ -315,14 +326,19 @@ typedef enum QCow2MetadataOverlap {
QCOW2_OL_INACTIVE_L2 = (1 << QCOW2_OL_INACTIVE_L2_BITNR),
} QCow2MetadataOverlap;
+/* Perform all overlap checks which can be done in constant time */
+#define QCOW2_OL_CONSTANT \
+ (QCOW2_OL_MAIN_HEADER | QCOW2_OL_ACTIVE_L1 | QCOW2_OL_REFCOUNT_TABLE | \
+ QCOW2_OL_SNAPSHOT_TABLE)
+
/* Perform all overlap checks which don't require disk access */
#define QCOW2_OL_CACHED \
- (QCOW2_OL_MAIN_HEADER | QCOW2_OL_ACTIVE_L1 | QCOW2_OL_ACTIVE_L2 | \
- QCOW2_OL_REFCOUNT_TABLE | QCOW2_OL_REFCOUNT_BLOCK | \
- QCOW2_OL_SNAPSHOT_TABLE | QCOW2_OL_INACTIVE_L1)
+ (QCOW2_OL_CONSTANT | QCOW2_OL_ACTIVE_L2 | QCOW2_OL_REFCOUNT_BLOCK | \
+ QCOW2_OL_INACTIVE_L1)
-/* The default checks to perform */
-#define QCOW2_OL_DEFAULT QCOW2_OL_CACHED
+/* Perform all overlap checks */
+#define QCOW2_OL_ALL \
+ (QCOW2_OL_CACHED | QCOW2_OL_INACTIVE_L2)
#define L1E_OFFSET_MASK 0x00ffffffffffff00ULL
#define L2E_OFFSET_MASK 0x00ffffffffffff00ULL
@@ -433,9 +449,9 @@ int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
void qcow2_process_discards(BlockDriverState *bs, int ret);
-int qcow2_check_metadata_overlap(BlockDriverState *bs, int chk, int64_t offset,
+int qcow2_check_metadata_overlap(BlockDriverState *bs, int ign, int64_t offset,
int64_t size);
-int qcow2_pre_write_overlap_check(BlockDriverState *bs, int chk, int64_t offset,
+int qcow2_pre_write_overlap_check(BlockDriverState *bs, int ign, int64_t offset,
int64_t size);
/* qcow2-cluster.c functions */