mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-08-26' into staging
Block patches: - qcow2 subclusters (extended L2 entries) # gpg: Signature made Wed 26 Aug 2020 08:37:04 BST # gpg: using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40 # gpg: issuer "mreitz@redhat.com" # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full] # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * remotes/maxreitz/tags/pull-block-2020-08-26: (34 commits) iotests: Add tests for qcow2 images with extended L2 entries qcow2: Assert that expand_zero_clusters_in_l1() does not support subclusters qcow2: Allow preallocation and backing files if extended_l2 is set qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit qcow2: Add prealloc field to QCowL2Meta qcow2: Add subcluster support to qcow2_measure() qcow2: Add subcluster support to qcow2_co_pwrite_zeroes() qcow2: Add subcluster support to handle_alloc_space() qcow2: Clear the L2 bitmap when allocating a compressed cluster qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2() qcow2: Add subcluster support to check_refcounts_l2() qcow2: Add subcluster support to discard_in_l2_slice() qcow2: Add subcluster support to zero_in_l2_slice() qcow2: Add subcluster support to qcow2_get_host_offset() qcow2: Add subcluster support to calculate_l2_meta() qcow2: Handle QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_* qcow2: Add cluster type parameter to qcow2_get_host_offset() qcow2: Add qcow2_cluster_is_allocated() qcow2: Add qcow2_get_subcluster_range_type() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+614
-292
File diff suppressed because it is too large
Load Diff
+28
-19
@@ -1254,7 +1254,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
|
||||
l2_slice = NULL;
|
||||
l1_table = NULL;
|
||||
l1_size2 = l1_size * sizeof(uint64_t);
|
||||
slice_size2 = s->l2_slice_size * sizeof(uint64_t);
|
||||
slice_size2 = s->l2_slice_size * l2_entry_size(s);
|
||||
n_slices = s->cluster_size / slice_size2;
|
||||
|
||||
s->cache_discards = true;
|
||||
@@ -1310,7 +1310,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
|
||||
uint64_t cluster_index;
|
||||
uint64_t offset;
|
||||
|
||||
entry = be64_to_cpu(l2_slice[j]);
|
||||
entry = get_l2_entry(s, l2_slice, j);
|
||||
old_entry = entry;
|
||||
entry &= ~QCOW_OFLAG_COPIED;
|
||||
offset = entry & L2E_OFFSET_MASK;
|
||||
@@ -1384,7 +1384,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
|
||||
qcow2_cache_set_dependency(bs, s->l2_table_cache,
|
||||
s->refcount_block_cache);
|
||||
}
|
||||
l2_slice[j] = cpu_to_be64(entry);
|
||||
set_l2_entry(s, l2_slice, j, entry);
|
||||
qcow2_cache_entry_mark_dirty(s->l2_table_cache,
|
||||
l2_slice);
|
||||
}
|
||||
@@ -1605,7 +1605,7 @@ static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res,
|
||||
int i, l2_size, nb_csectors, ret;
|
||||
|
||||
/* Read L2 table from disk */
|
||||
l2_size = s->l2_size * sizeof(uint64_t);
|
||||
l2_size = s->l2_size * l2_entry_size(s);
|
||||
l2_table = g_malloc(l2_size);
|
||||
|
||||
ret = bdrv_pread(bs->file, l2_offset, l2_table, l2_size);
|
||||
@@ -1617,7 +1617,7 @@ static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res,
|
||||
|
||||
/* Do the actual checks */
|
||||
for(i = 0; i < s->l2_size; i++) {
|
||||
l2_entry = be64_to_cpu(l2_table[i]);
|
||||
l2_entry = get_l2_entry(s, l2_table, i);
|
||||
|
||||
switch (qcow2_get_cluster_type(bs, l2_entry)) {
|
||||
case QCOW2_CLUSTER_COMPRESSED:
|
||||
@@ -1669,26 +1669,33 @@ static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res,
|
||||
|
||||
/* Correct offsets are cluster aligned */
|
||||
if (offset_into_cluster(s, offset)) {
|
||||
bool contains_data;
|
||||
res->corruptions++;
|
||||
|
||||
if (qcow2_get_cluster_type(bs, l2_entry) ==
|
||||
QCOW2_CLUSTER_ZERO_ALLOC)
|
||||
{
|
||||
fprintf(stderr, "%s offset=%" PRIx64 ": Preallocated zero "
|
||||
if (has_subclusters(s)) {
|
||||
uint64_t l2_bitmap = get_l2_bitmap(s, l2_table, i);
|
||||
contains_data = (l2_bitmap & QCOW_L2_BITMAP_ALL_ALLOC);
|
||||
} else {
|
||||
contains_data = !(l2_entry & QCOW_OFLAG_ZERO);
|
||||
}
|
||||
|
||||
if (!contains_data) {
|
||||
fprintf(stderr, "%s offset=%" PRIx64 ": Preallocated "
|
||||
"cluster is not properly aligned; L2 entry "
|
||||
"corrupted.\n",
|
||||
fix & BDRV_FIX_ERRORS ? "Repairing" : "ERROR",
|
||||
offset);
|
||||
if (fix & BDRV_FIX_ERRORS) {
|
||||
int idx = i * (l2_entry_size(s) / sizeof(uint64_t));
|
||||
uint64_t l2e_offset =
|
||||
l2_offset + (uint64_t)i * sizeof(uint64_t);
|
||||
l2_offset + (uint64_t)i * l2_entry_size(s);
|
||||
int ign = active ? QCOW2_OL_ACTIVE_L2 :
|
||||
QCOW2_OL_INACTIVE_L2;
|
||||
|
||||
l2_entry = QCOW_OFLAG_ZERO;
|
||||
l2_table[i] = cpu_to_be64(l2_entry);
|
||||
l2_entry = has_subclusters(s) ? 0 : QCOW_OFLAG_ZERO;
|
||||
set_l2_entry(s, l2_table, i, l2_entry);
|
||||
ret = qcow2_pre_write_overlap_check(bs, ign,
|
||||
l2e_offset, sizeof(uint64_t), false);
|
||||
l2e_offset, l2_entry_size(s), false);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "ERROR: Overlap check failed\n");
|
||||
res->check_errors++;
|
||||
@@ -1698,7 +1705,8 @@ static int check_refcounts_l2(BlockDriverState *bs, BdrvCheckResult *res,
|
||||
}
|
||||
|
||||
ret = bdrv_pwrite_sync(bs->file, l2e_offset,
|
||||
&l2_table[i], sizeof(uint64_t));
|
||||
&l2_table[idx],
|
||||
l2_entry_size(s));
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "ERROR: Failed to overwrite L2 "
|
||||
"table entry: %s\n", strerror(-ret));
|
||||
@@ -1905,7 +1913,7 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,
|
||||
}
|
||||
|
||||
ret = bdrv_pread(bs->file, l2_offset, l2_table,
|
||||
s->l2_size * sizeof(uint64_t));
|
||||
s->l2_size * l2_entry_size(s));
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "ERROR: Could not read L2 table: %s\n",
|
||||
strerror(-ret));
|
||||
@@ -1914,7 +1922,7 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,
|
||||
}
|
||||
|
||||
for (j = 0; j < s->l2_size; j++) {
|
||||
uint64_t l2_entry = be64_to_cpu(l2_table[j]);
|
||||
uint64_t l2_entry = get_l2_entry(s, l2_table, j);
|
||||
uint64_t data_offset = l2_entry & L2E_OFFSET_MASK;
|
||||
QCow2ClusterType cluster_type = qcow2_get_cluster_type(bs, l2_entry);
|
||||
|
||||
@@ -1937,9 +1945,10 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,
|
||||
"l2_entry=%" PRIx64 " refcount=%" PRIu64 "\n",
|
||||
repair ? "Repairing" : "ERROR", l2_entry, refcount);
|
||||
if (repair) {
|
||||
l2_table[j] = cpu_to_be64(refcount == 1
|
||||
? l2_entry | QCOW_OFLAG_COPIED
|
||||
: l2_entry & ~QCOW_OFLAG_COPIED);
|
||||
set_l2_entry(s, l2_table, j,
|
||||
refcount == 1 ?
|
||||
l2_entry | QCOW_OFLAG_COPIED :
|
||||
l2_entry & ~QCOW_OFLAG_COPIED);
|
||||
l2_dirty++;
|
||||
}
|
||||
}
|
||||
|
||||
+189
-113
File diff suppressed because it is too large
Load Diff
+205
-6
@@ -78,6 +78,27 @@
|
||||
/* The cluster reads as all zeros */
|
||||
#define QCOW_OFLAG_ZERO (1ULL << 0)
|
||||
|
||||
#define QCOW_EXTL2_SUBCLUSTERS_PER_CLUSTER 32
|
||||
|
||||
/* The subcluster X [0..31] is allocated */
|
||||
#define QCOW_OFLAG_SUB_ALLOC(X) (1ULL << (X))
|
||||
/* The subcluster X [0..31] reads as zeroes */
|
||||
#define QCOW_OFLAG_SUB_ZERO(X) (QCOW_OFLAG_SUB_ALLOC(X) << 32)
|
||||
/* Subclusters [X, Y) (0 <= X <= Y <= 32) are allocated */
|
||||
#define QCOW_OFLAG_SUB_ALLOC_RANGE(X, Y) \
|
||||
(QCOW_OFLAG_SUB_ALLOC(Y) - QCOW_OFLAG_SUB_ALLOC(X))
|
||||
/* Subclusters [X, Y) (0 <= X <= Y <= 32) read as zeroes */
|
||||
#define QCOW_OFLAG_SUB_ZERO_RANGE(X, Y) \
|
||||
(QCOW_OFLAG_SUB_ALLOC_RANGE(X, Y) << 32)
|
||||
/* L2 entry bitmap with all allocation bits set */
|
||||
#define QCOW_L2_BITMAP_ALL_ALLOC (QCOW_OFLAG_SUB_ALLOC_RANGE(0, 32))
|
||||
/* L2 entry bitmap with all "read as zeroes" bits set */
|
||||
#define QCOW_L2_BITMAP_ALL_ZEROES (QCOW_OFLAG_SUB_ZERO_RANGE(0, 32))
|
||||
|
||||
/* Size of normal and extended L2 entries */
|
||||
#define L2E_SIZE_NORMAL (sizeof(uint64_t))
|
||||
#define L2E_SIZE_EXTENDED (sizeof(uint64_t) * 2)
|
||||
|
||||
#define MIN_CLUSTER_BITS 9
|
||||
#define MAX_CLUSTER_BITS 21
|
||||
|
||||
@@ -225,15 +246,18 @@ enum {
|
||||
QCOW2_INCOMPAT_CORRUPT_BITNR = 1,
|
||||
QCOW2_INCOMPAT_DATA_FILE_BITNR = 2,
|
||||
QCOW2_INCOMPAT_COMPRESSION_BITNR = 3,
|
||||
QCOW2_INCOMPAT_EXTL2_BITNR = 4,
|
||||
QCOW2_INCOMPAT_DIRTY = 1 << QCOW2_INCOMPAT_DIRTY_BITNR,
|
||||
QCOW2_INCOMPAT_CORRUPT = 1 << QCOW2_INCOMPAT_CORRUPT_BITNR,
|
||||
QCOW2_INCOMPAT_DATA_FILE = 1 << QCOW2_INCOMPAT_DATA_FILE_BITNR,
|
||||
QCOW2_INCOMPAT_COMPRESSION = 1 << QCOW2_INCOMPAT_COMPRESSION_BITNR,
|
||||
QCOW2_INCOMPAT_EXTL2 = 1 << QCOW2_INCOMPAT_EXTL2_BITNR,
|
||||
|
||||
QCOW2_INCOMPAT_MASK = QCOW2_INCOMPAT_DIRTY
|
||||
| QCOW2_INCOMPAT_CORRUPT
|
||||
| QCOW2_INCOMPAT_DATA_FILE
|
||||
| QCOW2_INCOMPAT_COMPRESSION,
|
||||
| QCOW2_INCOMPAT_COMPRESSION
|
||||
| QCOW2_INCOMPAT_EXTL2,
|
||||
};
|
||||
|
||||
/* Compatible feature bits */
|
||||
@@ -295,6 +319,9 @@ typedef struct BDRVQcow2State {
|
||||
int cluster_bits;
|
||||
int cluster_size;
|
||||
int l2_slice_size;
|
||||
int subcluster_bits;
|
||||
int subcluster_size;
|
||||
int subclusters_per_cluster;
|
||||
int l2_bits;
|
||||
int l2_size;
|
||||
int l1_size;
|
||||
@@ -439,6 +466,14 @@ typedef struct QCowL2Meta
|
||||
*/
|
||||
bool skip_cow;
|
||||
|
||||
/**
|
||||
* Indicates that this is not a normal write request but a preallocation.
|
||||
* If the image has extended L2 entries this means that no new individual
|
||||
* subclusters will be marked as allocated in the L2 bitmap (but any
|
||||
* existing contents of that bitmap will be kept).
|
||||
*/
|
||||
bool prealloc;
|
||||
|
||||
/**
|
||||
* The I/O vector with the data from the actual guest write request.
|
||||
* If non-NULL, this is meant to be merged together with the data
|
||||
@@ -453,6 +488,33 @@ typedef struct QCowL2Meta
|
||||
QLIST_ENTRY(QCowL2Meta) next_in_flight;
|
||||
} QCowL2Meta;
|
||||
|
||||
/*
|
||||
* In images with standard L2 entries all clusters are treated as if
|
||||
* they had one subcluster so QCow2ClusterType and QCow2SubclusterType
|
||||
* can be mapped to each other and have the exact same meaning
|
||||
* (QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC cannot happen in these images).
|
||||
*
|
||||
* In images with extended L2 entries QCow2ClusterType refers to the
|
||||
* complete cluster and QCow2SubclusterType to each of the individual
|
||||
* subclusters, so there are several possible combinations:
|
||||
*
|
||||
* |--------------+---------------------------|
|
||||
* | Cluster type | Possible subcluster types |
|
||||
* |--------------+---------------------------|
|
||||
* | UNALLOCATED | UNALLOCATED_PLAIN |
|
||||
* | | ZERO_PLAIN |
|
||||
* |--------------+---------------------------|
|
||||
* | NORMAL | UNALLOCATED_ALLOC |
|
||||
* | | ZERO_ALLOC |
|
||||
* | | NORMAL |
|
||||
* |--------------+---------------------------|
|
||||
* | COMPRESSED | COMPRESSED |
|
||||
* |--------------+---------------------------|
|
||||
*
|
||||
* QCOW2_SUBCLUSTER_INVALID means that the L2 entry is incorrect and
|
||||
* the image should be marked corrupt.
|
||||
*/
|
||||
|
||||
typedef enum QCow2ClusterType {
|
||||
QCOW2_CLUSTER_UNALLOCATED,
|
||||
QCOW2_CLUSTER_ZERO_PLAIN,
|
||||
@@ -461,6 +523,16 @@ typedef enum QCow2ClusterType {
|
||||
QCOW2_CLUSTER_COMPRESSED,
|
||||
} QCow2ClusterType;
|
||||
|
||||
typedef enum QCow2SubclusterType {
|
||||
QCOW2_SUBCLUSTER_UNALLOCATED_PLAIN,
|
||||
QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC,
|
||||
QCOW2_SUBCLUSTER_ZERO_PLAIN,
|
||||
QCOW2_SUBCLUSTER_ZERO_ALLOC,
|
||||
QCOW2_SUBCLUSTER_NORMAL,
|
||||
QCOW2_SUBCLUSTER_COMPRESSED,
|
||||
QCOW2_SUBCLUSTER_INVALID,
|
||||
} QCow2SubclusterType;
|
||||
|
||||
typedef enum QCow2MetadataOverlap {
|
||||
QCOW2_OL_MAIN_HEADER_BITNR = 0,
|
||||
QCOW2_OL_ACTIVE_L1_BITNR = 1,
|
||||
@@ -510,6 +582,49 @@ typedef enum QCow2MetadataOverlap {
|
||||
|
||||
#define INV_OFFSET (-1ULL)
|
||||
|
||||
static inline bool has_subclusters(BDRVQcow2State *s)
|
||||
{
|
||||
return s->incompatible_features & QCOW2_INCOMPAT_EXTL2;
|
||||
}
|
||||
|
||||
static inline size_t l2_entry_size(BDRVQcow2State *s)
|
||||
{
|
||||
return has_subclusters(s) ? L2E_SIZE_EXTENDED : L2E_SIZE_NORMAL;
|
||||
}
|
||||
|
||||
static inline uint64_t get_l2_entry(BDRVQcow2State *s, uint64_t *l2_slice,
|
||||
int idx)
|
||||
{
|
||||
idx *= l2_entry_size(s) / sizeof(uint64_t);
|
||||
return be64_to_cpu(l2_slice[idx]);
|
||||
}
|
||||
|
||||
static inline uint64_t get_l2_bitmap(BDRVQcow2State *s, uint64_t *l2_slice,
|
||||
int idx)
|
||||
{
|
||||
if (has_subclusters(s)) {
|
||||
idx *= l2_entry_size(s) / sizeof(uint64_t);
|
||||
return be64_to_cpu(l2_slice[idx + 1]);
|
||||
} else {
|
||||
return 0; /* For convenience only; this value has no meaning. */
|
||||
}
|
||||
}
|
||||
|
||||
static inline void set_l2_entry(BDRVQcow2State *s, uint64_t *l2_slice,
|
||||
int idx, uint64_t entry)
|
||||
{
|
||||
idx *= l2_entry_size(s) / sizeof(uint64_t);
|
||||
l2_slice[idx] = cpu_to_be64(entry);
|
||||
}
|
||||
|
||||
static inline void set_l2_bitmap(BDRVQcow2State *s, uint64_t *l2_slice,
|
||||
int idx, uint64_t bitmap)
|
||||
{
|
||||
assert(has_subclusters(s));
|
||||
idx *= l2_entry_size(s) / sizeof(uint64_t);
|
||||
l2_slice[idx + 1] = cpu_to_be64(bitmap);
|
||||
}
|
||||
|
||||
static inline bool has_data_file(BlockDriverState *bs)
|
||||
{
|
||||
BDRVQcow2State *s = bs->opaque;
|
||||
@@ -532,11 +647,21 @@ static inline int64_t offset_into_cluster(BDRVQcow2State *s, int64_t offset)
|
||||
return offset & (s->cluster_size - 1);
|
||||
}
|
||||
|
||||
static inline int64_t offset_into_subcluster(BDRVQcow2State *s, int64_t offset)
|
||||
{
|
||||
return offset & (s->subcluster_size - 1);
|
||||
}
|
||||
|
||||
static inline uint64_t size_to_clusters(BDRVQcow2State *s, uint64_t size)
|
||||
{
|
||||
return (size + (s->cluster_size - 1)) >> s->cluster_bits;
|
||||
}
|
||||
|
||||
static inline uint64_t size_to_subclusters(BDRVQcow2State *s, uint64_t size)
|
||||
{
|
||||
return (size + (s->subcluster_size - 1)) >> s->subcluster_bits;
|
||||
}
|
||||
|
||||
static inline int64_t size_to_l1(BDRVQcow2State *s, int64_t size)
|
||||
{
|
||||
int shift = s->cluster_bits + s->l2_bits;
|
||||
@@ -558,6 +683,11 @@ static inline int offset_to_l2_slice_index(BDRVQcow2State *s, int64_t offset)
|
||||
return (offset >> s->cluster_bits) & (s->l2_slice_size - 1);
|
||||
}
|
||||
|
||||
static inline int offset_to_sc_index(BDRVQcow2State *s, int64_t offset)
|
||||
{
|
||||
return (offset >> s->subcluster_bits) & (s->subclusters_per_cluster - 1);
|
||||
}
|
||||
|
||||
static inline int64_t qcow2_vm_state_offset(BDRVQcow2State *s)
|
||||
{
|
||||
return (int64_t)s->l1_vm_state_index << (s->cluster_bits + s->l2_bits);
|
||||
@@ -566,9 +696,11 @@ static inline int64_t qcow2_vm_state_offset(BDRVQcow2State *s)
|
||||
static inline QCow2ClusterType qcow2_get_cluster_type(BlockDriverState *bs,
|
||||
uint64_t l2_entry)
|
||||
{
|
||||
BDRVQcow2State *s = bs->opaque;
|
||||
|
||||
if (l2_entry & QCOW_OFLAG_COMPRESSED) {
|
||||
return QCOW2_CLUSTER_COMPRESSED;
|
||||
} else if (l2_entry & QCOW_OFLAG_ZERO) {
|
||||
} else if ((l2_entry & QCOW_OFLAG_ZERO) && !has_subclusters(s)) {
|
||||
if (l2_entry & L2E_OFFSET_MASK) {
|
||||
return QCOW2_CLUSTER_ZERO_ALLOC;
|
||||
}
|
||||
@@ -588,6 +720,72 @@ static inline QCow2ClusterType qcow2_get_cluster_type(BlockDriverState *bs,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* In an image without subsclusters @l2_bitmap is ignored and
|
||||
* @sc_index must be 0.
|
||||
* Return QCOW2_SUBCLUSTER_INVALID if an invalid l2 entry is detected
|
||||
* (this checks the whole entry and bitmap, not only the bits related
|
||||
* to subcluster @sc_index).
|
||||
*/
|
||||
static inline
|
||||
QCow2SubclusterType qcow2_get_subcluster_type(BlockDriverState *bs,
|
||||
uint64_t l2_entry,
|
||||
uint64_t l2_bitmap,
|
||||
unsigned sc_index)
|
||||
{
|
||||
BDRVQcow2State *s = bs->opaque;
|
||||
QCow2ClusterType type = qcow2_get_cluster_type(bs, l2_entry);
|
||||
assert(sc_index < s->subclusters_per_cluster);
|
||||
|
||||
if (has_subclusters(s)) {
|
||||
switch (type) {
|
||||
case QCOW2_CLUSTER_COMPRESSED:
|
||||
return QCOW2_SUBCLUSTER_COMPRESSED;
|
||||
case QCOW2_CLUSTER_NORMAL:
|
||||
if ((l2_bitmap >> 32) & l2_bitmap) {
|
||||
return QCOW2_SUBCLUSTER_INVALID;
|
||||
} else if (l2_bitmap & QCOW_OFLAG_SUB_ZERO(sc_index)) {
|
||||
return QCOW2_SUBCLUSTER_ZERO_ALLOC;
|
||||
} else if (l2_bitmap & QCOW_OFLAG_SUB_ALLOC(sc_index)) {
|
||||
return QCOW2_SUBCLUSTER_NORMAL;
|
||||
} else {
|
||||
return QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC;
|
||||
}
|
||||
case QCOW2_CLUSTER_UNALLOCATED:
|
||||
if (l2_bitmap & QCOW_L2_BITMAP_ALL_ALLOC) {
|
||||
return QCOW2_SUBCLUSTER_INVALID;
|
||||
} else if (l2_bitmap & QCOW_OFLAG_SUB_ZERO(sc_index)) {
|
||||
return QCOW2_SUBCLUSTER_ZERO_PLAIN;
|
||||
} else {
|
||||
return QCOW2_SUBCLUSTER_UNALLOCATED_PLAIN;
|
||||
}
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
} else {
|
||||
switch (type) {
|
||||
case QCOW2_CLUSTER_COMPRESSED:
|
||||
return QCOW2_SUBCLUSTER_COMPRESSED;
|
||||
case QCOW2_CLUSTER_ZERO_PLAIN:
|
||||
return QCOW2_SUBCLUSTER_ZERO_PLAIN;
|
||||
case QCOW2_CLUSTER_ZERO_ALLOC:
|
||||
return QCOW2_SUBCLUSTER_ZERO_ALLOC;
|
||||
case QCOW2_CLUSTER_NORMAL:
|
||||
return QCOW2_SUBCLUSTER_NORMAL;
|
||||
case QCOW2_CLUSTER_UNALLOCATED:
|
||||
return QCOW2_SUBCLUSTER_UNALLOCATED_PLAIN;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool qcow2_cluster_is_allocated(QCow2ClusterType type)
|
||||
{
|
||||
return (type == QCOW2_CLUSTER_COMPRESSED || type == QCOW2_CLUSTER_NORMAL ||
|
||||
type == QCOW2_CLUSTER_ZERO_ALLOC);
|
||||
}
|
||||
|
||||
/* Check whether refcounts are eager or lazy */
|
||||
static inline bool qcow2_need_accurate_refcounts(BDRVQcow2State *s)
|
||||
{
|
||||
@@ -694,8 +892,9 @@ int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index);
|
||||
int qcow2_encrypt_sectors(BDRVQcow2State *s, int64_t sector_num,
|
||||
uint8_t *buf, int nb_sectors, bool enc, Error **errp);
|
||||
|
||||
int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
|
||||
unsigned int *bytes, uint64_t *cluster_offset);
|
||||
int qcow2_get_host_offset(BlockDriverState *bs, uint64_t offset,
|
||||
unsigned int *bytes, uint64_t *host_offset,
|
||||
QCow2SubclusterType *subcluster_type);
|
||||
int qcow2_alloc_cluster_offset(BlockDriverState *bs, uint64_t offset,
|
||||
unsigned int *bytes, uint64_t *host_offset,
|
||||
QCowL2Meta **m);
|
||||
@@ -709,8 +908,8 @@ void qcow2_alloc_cluster_abort(BlockDriverState *bs, QCowL2Meta *m);
|
||||
int qcow2_cluster_discard(BlockDriverState *bs, uint64_t offset,
|
||||
uint64_t bytes, enum qcow2_discard_type type,
|
||||
bool full_discard);
|
||||
int qcow2_cluster_zeroize(BlockDriverState *bs, uint64_t offset,
|
||||
uint64_t bytes, int flags);
|
||||
int qcow2_subcluster_zeroize(BlockDriverState *bs, uint64_t offset,
|
||||
uint64_t bytes, int flags);
|
||||
|
||||
int qcow2_expand_zero_clusters(BlockDriverState *bs,
|
||||
BlockDriverAmendStatusCB *status_cb,
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ luring_io_uring_submit(void *s, int ret) "LuringState %p ret %d"
|
||||
luring_resubmit_short_read(void *s, void *luringcb, int nread) "LuringState %p luringcb %p nread %d"
|
||||
|
||||
# qcow2.c
|
||||
qcow2_add_task(void *co, void *bs, void *pool, const char *action, int cluster_type, uint64_t file_cluster_offset, uint64_t offset, uint64_t bytes, void *qiov, size_t qiov_offset) "co %p bs %p pool %p: %s: cluster_type %d file_cluster_offset %" PRIu64 " offset %" PRIu64 " bytes %" PRIu64 " qiov %p qiov_offset %zu"
|
||||
qcow2_add_task(void *co, void *bs, void *pool, const char *action, int cluster_type, uint64_t host_offset, uint64_t offset, uint64_t bytes, void *qiov, size_t qiov_offset) "co %p bs %p pool %p: %s: cluster_type %d file_cluster_offset %" PRIu64 " offset %" PRIu64 " bytes %" PRIu64 " qiov %p qiov_offset %zu"
|
||||
qcow2_writev_start_req(void *co, int64_t offset, int bytes) "co %p offset 0x%" PRIx64 " bytes %d"
|
||||
qcow2_writev_done_req(void *co, int ret) "co %p ret %d"
|
||||
qcow2_writev_start_part(void *co) "co %p"
|
||||
|
||||
+65
-3
@@ -42,6 +42,9 @@ The first cluster of a qcow2 image contains the file header:
|
||||
as the maximum cluster size and won't be able to open images
|
||||
with larger cluster sizes.
|
||||
|
||||
Note: if the image has Extended L2 Entries then cluster_bits
|
||||
must be at least 14 (i.e. 16384 byte clusters).
|
||||
|
||||
24 - 31: size
|
||||
Virtual disk size in bytes.
|
||||
|
||||
@@ -117,7 +120,12 @@ the next fields through header_length.
|
||||
clusters. The compression_type field must be
|
||||
present and not zero.
|
||||
|
||||
Bits 4-63: Reserved (set to 0)
|
||||
Bit 4: Extended L2 Entries. If this bit is set then
|
||||
L2 table entries use an extended format that
|
||||
allows subcluster-based allocation. See the
|
||||
Extended L2 Entries section for more details.
|
||||
|
||||
Bits 5-63: Reserved (set to 0)
|
||||
|
||||
80 - 87: compatible_features
|
||||
Bitmask of compatible features. An implementation can
|
||||
@@ -498,7 +506,7 @@ cannot be relaxed without an incompatible layout change).
|
||||
Given an offset into the virtual disk, the offset into the image file can be
|
||||
obtained as follows:
|
||||
|
||||
l2_entries = (cluster_size / sizeof(uint64_t))
|
||||
l2_entries = (cluster_size / sizeof(uint64_t)) [*]
|
||||
|
||||
l2_index = (offset / cluster_size) % l2_entries
|
||||
l1_index = (offset / cluster_size) / l2_entries
|
||||
@@ -508,6 +516,8 @@ obtained as follows:
|
||||
|
||||
return cluster_offset + (offset % cluster_size)
|
||||
|
||||
[*] this changes if Extended L2 Entries are enabled, see next section
|
||||
|
||||
L1 table entry:
|
||||
|
||||
Bit 0 - 8: Reserved (set to 0)
|
||||
@@ -548,7 +558,8 @@ Standard Cluster Descriptor:
|
||||
nor is data read from the backing file if the cluster is
|
||||
unallocated.
|
||||
|
||||
With version 2, this is always 0.
|
||||
With version 2 or with extended L2 entries (see the next
|
||||
section), this is always 0.
|
||||
|
||||
1 - 8: Reserved (set to 0)
|
||||
|
||||
@@ -585,6 +596,57 @@ file (except if bit 0 in the Standard Cluster Descriptor is set). If there is
|
||||
no backing file or the backing file is smaller than the image, they shall read
|
||||
zeros for all parts that are not covered by the backing file.
|
||||
|
||||
== Extended L2 Entries ==
|
||||
|
||||
An image uses Extended L2 Entries if bit 4 is set on the incompatible_features
|
||||
field of the header.
|
||||
|
||||
In these images standard data clusters are divided into 32 subclusters of the
|
||||
same size. They are contiguous and start from the beginning of the cluster.
|
||||
Subclusters can be allocated independently and the L2 entry contains information
|
||||
indicating the status of each one of them. Compressed data clusters don't have
|
||||
subclusters so they are treated the same as in images without this feature.
|
||||
|
||||
The size of an extended L2 entry is 128 bits so the number of entries per table
|
||||
is calculated using this formula:
|
||||
|
||||
l2_entries = (cluster_size / (2 * sizeof(uint64_t)))
|
||||
|
||||
The first 64 bits have the same format as the standard L2 table entry described
|
||||
in the previous section, with the exception of bit 0 of the standard cluster
|
||||
descriptor.
|
||||
|
||||
The last 64 bits contain a subcluster allocation bitmap with this format:
|
||||
|
||||
Subcluster Allocation Bitmap (for standard clusters):
|
||||
|
||||
Bit 0 - 31: Allocation status (one bit per subcluster)
|
||||
|
||||
1: the subcluster is allocated. In this case the
|
||||
host cluster offset field must contain a valid
|
||||
offset.
|
||||
0: the subcluster is not allocated. In this case
|
||||
read requests shall go to the backing file or
|
||||
return zeros if there is no backing file data.
|
||||
|
||||
Bits are assigned starting from the least significant
|
||||
one (i.e. bit x is used for subcluster x).
|
||||
|
||||
32 - 63 Subcluster reads as zeros (one bit per subcluster)
|
||||
|
||||
1: the subcluster reads as zeros. In this case the
|
||||
allocation status bit must be unset. The host
|
||||
cluster offset field may or may not be set.
|
||||
0: no effect.
|
||||
|
||||
Bits are assigned starting from the least significant
|
||||
one (i.e. bit x is used for subcluster x - 32).
|
||||
|
||||
Subcluster Allocation Bitmap (for compressed clusters):
|
||||
|
||||
Bit 0 - 63: Reserved (set to 0)
|
||||
Compressed clusters don't have subclusters,
|
||||
so this field is not used.
|
||||
|
||||
== Snapshots ==
|
||||
|
||||
|
||||
+18
-1
@@ -1,6 +1,6 @@
|
||||
qcow2 L2/refcount cache configuration
|
||||
=====================================
|
||||
Copyright (C) 2015, 2018 Igalia, S.L.
|
||||
Copyright (C) 2015, 2018-2020 Igalia, S.L.
|
||||
Author: Alberto Garcia <berto@igalia.com>
|
||||
|
||||
This work is licensed under the terms of the GNU GPL, version 2 or
|
||||
@@ -222,3 +222,20 @@ support this functionality, and is 0 (disabled) on other platforms.
|
||||
This functionality currently relies on the MADV_DONTNEED argument for
|
||||
madvise() to actually free the memory. This is a Linux-specific feature,
|
||||
so cache-clean-interval is not supported on other systems.
|
||||
|
||||
|
||||
Extended L2 Entries
|
||||
-------------------
|
||||
All numbers shown in this document are valid for qcow2 images with normal
|
||||
64-bit L2 entries.
|
||||
|
||||
Images with extended L2 entries need twice as much L2 metadata, so the L2
|
||||
cache size must be twice as large for the same disk space.
|
||||
|
||||
disk_size = l2_cache_size * cluster_size / 16
|
||||
|
||||
i.e.
|
||||
|
||||
l2_cache_size = disk_size * 16 / cluster_size
|
||||
|
||||
Refcount blocks are not affected by this.
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#define BLOCK_OPT_DATA_FILE "data_file"
|
||||
#define BLOCK_OPT_DATA_FILE_RAW "data_file_raw"
|
||||
#define BLOCK_OPT_COMPRESSION_TYPE "compression_type"
|
||||
#define BLOCK_OPT_EXTL2 "extended_l2"
|
||||
|
||||
#define BLOCK_PROBE_BUF_SIZE 512
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
# standalone (read-only) raw image without looking at qcow2
|
||||
# metadata (since: 4.0)
|
||||
#
|
||||
# @extended-l2: true if the image has extended L2 entries; only valid for
|
||||
# compat >= 1.1 (since 5.2)
|
||||
#
|
||||
# @lazy-refcounts: on or off; only valid for compat >= 1.1
|
||||
#
|
||||
# @corrupt: true if the image has been marked corrupt; only valid for
|
||||
@@ -88,6 +91,7 @@
|
||||
'compat': 'str',
|
||||
'*data-file': 'str',
|
||||
'*data-file-raw': 'bool',
|
||||
'*extended-l2': 'bool',
|
||||
'*lazy-refcounts': 'bool',
|
||||
'*corrupt': 'bool',
|
||||
'refcount-bits': 'int',
|
||||
@@ -4304,6 +4308,8 @@
|
||||
# @data-file-raw: True if the external data file must stay valid as a
|
||||
# standalone (read-only) raw image without looking at qcow2
|
||||
# metadata (default: false; since: 4.0)
|
||||
# @extended-l2 True to make the image have extended L2 entries
|
||||
# (default: false; since 5.2)
|
||||
# @size: Size of the virtual disk in bytes
|
||||
# @version: Compatibility level (default: v3)
|
||||
# @backing-file: File name of the backing file if a backing file
|
||||
@@ -4324,6 +4330,7 @@
|
||||
'data': { 'file': 'BlockdevRef',
|
||||
'*data-file': 'BlockdevRef',
|
||||
'*data-file-raw': 'bool',
|
||||
'*extended-l2': 'bool',
|
||||
'size': 'size',
|
||||
'*version': 'BlockdevQcow2Version',
|
||||
'*backing-file': 'str',
|
||||
|
||||
@@ -117,7 +117,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
Header extension:
|
||||
@@ -150,7 +150,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
Header extension:
|
||||
@@ -164,7 +164,7 @@ No errors were found on the image.
|
||||
|
||||
magic 0x514649fb
|
||||
version 3
|
||||
backing_file_offset 0x210
|
||||
backing_file_offset 0x240
|
||||
backing_file_size 0x17
|
||||
cluster_bits 16
|
||||
size 67108864
|
||||
@@ -188,7 +188,7 @@ data 'host_device'
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
Header extension:
|
||||
|
||||
@@ -26,7 +26,7 @@ compatible_features []
|
||||
autoclear_features [63]
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ compatible_features []
|
||||
autoclear_features []
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
*** done
|
||||
|
||||
+51
-51
@@ -4,90 +4,90 @@ QA output created by 049
|
||||
== 1. Traditional size parameter ==
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024b
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1k
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1K
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1048576 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1048576 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1G
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1073741824 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1073741824 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1T
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1099511627776 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1099511627776 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0b
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5k
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5K
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1572864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1572864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5G
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1610612736 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1610612736 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5T
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1649267441664 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1649267441664 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
== 2. Specifying size via -o ==
|
||||
|
||||
qemu-img create -f qcow2 -o size=1024 TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1024b TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1k TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1K TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1M TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1048576 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1048576 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1G TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1073741824 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1073741824 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1T TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1099511627776 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1099511627776 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1024.0 TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1024.0b TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1024 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1.5k TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1.5K TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1536 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1.5M TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1572864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1572864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1.5G TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1610612736 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1610612736 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o size=1.5T TEST_DIR/t.qcow2
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=1649267441664 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=1649267441664 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
== 3. Invalid sizes ==
|
||||
|
||||
@@ -129,84 +129,84 @@ qemu-img: TEST_DIR/t.qcow2: The image size must be specified only once
|
||||
== Check correct interpretation of suffixes for cluster size ==
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=1024 TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=1024b TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=1k TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=1K TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=1M TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1048576 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1048576 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=1024.0 TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=1024.0b TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=1024 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=0.5k TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=512 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=512 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=0.5K TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=512 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=512 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o cluster_size=0.5M TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=524288 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=524288 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
== Check compat level option ==
|
||||
|
||||
qemu-img create -f qcow2 -o compat=0.10 TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o compat=1.1 TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o compat=0.42 TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.42 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=0.42 lazy_refcounts=off refcount_bits=16
|
||||
qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'
|
||||
|
||||
qemu-img create -f qcow2 -o compat=foobar TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=foobar lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=foobar lazy_refcounts=off refcount_bits=16
|
||||
qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'
|
||||
|
||||
== Check preallocation option ==
|
||||
|
||||
qemu-img create -f qcow2 -o preallocation=off TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 preallocation=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o preallocation=metadata TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 preallocation=metadata compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=metadata compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o preallocation=1234 TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 preallocation=1234 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off preallocation=1234 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'
|
||||
|
||||
== Check encryption option ==
|
||||
|
||||
qemu-img create -f qcow2 -o encryption=off TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 encryption=off cluster_size=65536 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 encryption=off cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 --object secret,id=sec0,data=123456 -o encryption=on,encrypt.key-secret=sec0 TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 encryption=on encrypt.key-secret=sec0 cluster_size=65536 compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 encryption=on encrypt.key-secret=sec0 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
== Check lazy_refcounts option (only with v3) ==
|
||||
|
||||
qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=off TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=on TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=on refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=1.1 lazy_refcounts=on refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=off TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=on TEST_DIR/t.qcow2 64M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=on refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=67108864 compat=0.10 lazy_refcounts=on refcount_bits=16
|
||||
qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
|
||||
|
||||
*** done
|
||||
|
||||
@@ -21,6 +21,7 @@ Format specific information:
|
||||
lazy refcounts: false
|
||||
refcount bits: 16
|
||||
corrupt: true
|
||||
extended l2: false
|
||||
qemu-io: can't open device TEST_DIR/t.IMGFMT: IMGFMT: Image is corrupt; cannot be opened read/write
|
||||
no file open, try 'help open'
|
||||
read 512/512 bytes at offset 0
|
||||
@@ -320,7 +321,7 @@ discard 65536/65536 bytes at offset 0
|
||||
qcow2: Marking image as corrupt: Preallocated zero cluster offset 0x2a00 unaligned (guest offset: 0); further corruption events will be suppressed
|
||||
write failed: Input/output error
|
||||
--- Repairing ---
|
||||
Repairing offset=2a00: Preallocated zero cluster is not properly aligned; L2 entry corrupted.
|
||||
Repairing offset=2a00: Preallocated cluster is not properly aligned; L2 entry corrupted.
|
||||
The following inconsistencies were found and repaired:
|
||||
|
||||
0 leaked clusters
|
||||
|
||||
@@ -303,6 +303,12 @@ $QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
|
||||
_img_info --format-specific
|
||||
_check_test_img
|
||||
|
||||
echo
|
||||
echo "=== Testing version downgrade with extended L2 entries ==="
|
||||
echo
|
||||
_make_test_img -o "compat=1.1,extended_l2=on" 64M
|
||||
$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG"
|
||||
|
||||
echo
|
||||
echo "=== Try changing the external data file ==="
|
||||
echo
|
||||
|
||||
@@ -26,7 +26,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
magic 0x514649fb
|
||||
@@ -84,7 +84,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
magic 0x514649fb
|
||||
@@ -140,7 +140,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
ERROR cluster 5 refcount=0 reference=1
|
||||
@@ -195,7 +195,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
magic 0x514649fb
|
||||
@@ -264,7 +264,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
read 65536/65536 bytes at offset 44040192
|
||||
@@ -326,7 +326,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
ERROR cluster 5 refcount=0 reference=1
|
||||
@@ -355,7 +355,7 @@ header_length 112
|
||||
|
||||
Header extension:
|
||||
magic 0x6803f857 (Feature table)
|
||||
length 336
|
||||
length 384
|
||||
data <binary>
|
||||
|
||||
read 131072/131072 bytes at offset 0
|
||||
@@ -530,8 +530,14 @@ Format specific information:
|
||||
data file: TEST_DIR/t.IMGFMT.data
|
||||
data file raw: false
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
No errors were found on the image.
|
||||
|
||||
=== Testing version downgrade with extended L2 entries ===
|
||||
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
|
||||
qemu-img: Cannot downgrade an image with incompatible features 0x10 set
|
||||
|
||||
=== Try changing the external data file ===
|
||||
|
||||
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
|
||||
@@ -551,6 +557,7 @@ Format specific information:
|
||||
data file: foo
|
||||
data file raw: false
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
qemu-img: Could not open 'TEST_DIR/t.IMGFMT': 'data-file' is required for this image
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
@@ -564,6 +571,7 @@ Format specific information:
|
||||
refcount bits: 16
|
||||
data file raw: false
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
=== Clearing and setting data-file-raw ===
|
||||
|
||||
@@ -580,6 +588,7 @@ Format specific information:
|
||||
data file: TEST_DIR/t.IMGFMT.data
|
||||
data file raw: true
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
No errors were found on the image.
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
@@ -593,6 +602,7 @@ Format specific information:
|
||||
data file: TEST_DIR/t.IMGFMT.data
|
||||
data file raw: false
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
No errors were found on the image.
|
||||
qemu-img: data-file-raw cannot be set on existing images
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
@@ -607,5 +617,6 @@ Format specific information:
|
||||
data file: TEST_DIR/t.IMGFMT.data
|
||||
data file raw: false
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
No errors were found on the image.
|
||||
*** done
|
||||
|
||||
@@ -98,20 +98,20 @@ class TestQCow3NotLazy(TestQemuImgInfo):
|
||||
img_options = 'compat=1.1,lazy_refcounts=off'
|
||||
json_compare = { 'compat': '1.1', 'lazy-refcounts': False,
|
||||
'refcount-bits': 16, 'corrupt': False,
|
||||
'compression-type': 'zlib' }
|
||||
'compression-type': 'zlib', 'extended-l2': False }
|
||||
human_compare = [ 'compat: 1.1', 'compression type: zlib',
|
||||
'lazy refcounts: false', 'refcount bits: 16',
|
||||
'corrupt: false' ]
|
||||
'corrupt: false', 'extended l2: false' ]
|
||||
|
||||
class TestQCow3Lazy(TestQemuImgInfo):
|
||||
'''Testing a qcow2 version 3 image with lazy refcounts enabled'''
|
||||
img_options = 'compat=1.1,lazy_refcounts=on'
|
||||
json_compare = { 'compat': '1.1', 'lazy-refcounts': True,
|
||||
'refcount-bits': 16, 'corrupt': False,
|
||||
'compression-type': 'zlib' }
|
||||
'compression-type': 'zlib', 'extended-l2': False }
|
||||
human_compare = [ 'compat: 1.1', 'compression type: zlib',
|
||||
'lazy refcounts: true', 'refcount bits: 16',
|
||||
'corrupt: false' ]
|
||||
'corrupt: false', 'extended l2: false' ]
|
||||
|
||||
class TestQCow3NotLazyQMP(TestQMP):
|
||||
'''Testing a qcow2 version 3 image with lazy refcounts disabled, opening
|
||||
@@ -120,7 +120,7 @@ class TestQCow3NotLazyQMP(TestQMP):
|
||||
qemu_options = 'lazy-refcounts=on'
|
||||
compare = { 'compat': '1.1', 'lazy-refcounts': False,
|
||||
'refcount-bits': 16, 'corrupt': False,
|
||||
'compression-type': 'zlib' }
|
||||
'compression-type': 'zlib', 'extended-l2': False }
|
||||
|
||||
|
||||
class TestQCow3LazyQMP(TestQMP):
|
||||
@@ -130,7 +130,7 @@ class TestQCow3LazyQMP(TestQMP):
|
||||
qemu_options = 'lazy-refcounts=off'
|
||||
compare = { 'compat': '1.1', 'lazy-refcounts': True,
|
||||
'refcount-bits': 16, 'corrupt': False,
|
||||
'compression-type': 'zlib' }
|
||||
'compression-type': 'zlib', 'extended-l2': False }
|
||||
|
||||
TestImageInfoSpecific = None
|
||||
TestQemuImgInfo = None
|
||||
|
||||
@@ -3,14 +3,14 @@ QA output created by 082
|
||||
=== create: Options specified more than once ===
|
||||
|
||||
Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=off refcount_bits=16
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 128 MiB (134217728 bytes)
|
||||
cluster_size: 65536
|
||||
|
||||
Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 128M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=4096 compression_type=zlib size=134217728 lazy_refcounts=on refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=4096 extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=on refcount_bits=16
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 128 MiB (134217728 bytes)
|
||||
@@ -21,9 +21,10 @@ Format specific information:
|
||||
lazy refcounts: true
|
||||
refcount bits: 16
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 128M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=8192 compression_type=zlib size=134217728 lazy_refcounts=on refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=8192 extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=on refcount_bits=16
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 128 MiB (134217728 bytes)
|
||||
@@ -34,9 +35,10 @@ Format specific information:
|
||||
lazy refcounts: true
|
||||
refcount bits: 16
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
Testing: create -f qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 128M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=8192 compression_type=zlib size=134217728 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=8192 extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=off refcount_bits=16
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
file format: IMGFMT
|
||||
virtual size: 128 MiB (134217728 bytes)
|
||||
@@ -62,6 +64,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -87,6 +90,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -112,6 +116,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -137,6 +142,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -162,6 +168,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -187,6 +194,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -212,6 +220,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -237,6 +246,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -245,10 +255,10 @@ Supported options:
|
||||
size=<size> - Virtual disk size
|
||||
|
||||
Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help -F qcow2 TEST_DIR/t.qcow2 128M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,help backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,help backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? -F qcow2 TEST_DIR/t.qcow2 128M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,? backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2,,? backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 128M
|
||||
qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2,
|
||||
@@ -277,6 +287,7 @@ Supported qcow2 options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
preallocation=<str> - Preallocation mode (allowed values: off, metadata, falloc, full)
|
||||
refcount_bits=<num> - Width of a reference count entry in bits
|
||||
@@ -298,7 +309,7 @@ qemu-img: Format driver 'bochs' does not support image creation
|
||||
=== convert: Options specified more than once ===
|
||||
|
||||
Testing: create -f qcow2 TEST_DIR/t.qcow2 128M
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 lazy_refcounts=off refcount_bits=16
|
||||
|
||||
Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
|
||||
image: TEST_DIR/t.IMGFMT.base
|
||||
@@ -322,6 +333,7 @@ Format specific information:
|
||||
lazy refcounts: true
|
||||
refcount bits: 16
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
|
||||
image: TEST_DIR/t.IMGFMT.base
|
||||
@@ -334,6 +346,7 @@ Format specific information:
|
||||
lazy refcounts: true
|
||||
refcount bits: 16
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
Testing: convert -O qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
|
||||
image: TEST_DIR/t.IMGFMT.base
|
||||
@@ -361,6 +374,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -386,6 +400,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -411,6 +426,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -436,6 +452,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -461,6 +478,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -486,6 +504,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -511,6 +530,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -536,6 +556,7 @@ Supported options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
extent_size_hint=<size> - Extent size hint for the image file, 0 to disable
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
nocow=<bool (on/off)> - Turn off copy-on-write (valid only on btrfs)
|
||||
@@ -576,6 +597,7 @@ Supported qcow2 options:
|
||||
encrypt.ivgen-hash-alg=<str> - Name of IV generator hash algorithm
|
||||
encrypt.key-secret=<str> - ID of secret providing qcow AES key or LUKS passphrase
|
||||
encryption=<bool (on/off)> - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes)
|
||||
extended_l2=<bool (on/off)> - Extended L2 tables
|
||||
lazy_refcounts=<bool (on/off)> - Postpone refcount updates
|
||||
preallocation=<str> - Preallocation mode (allowed values: off, metadata, falloc, full)
|
||||
refcount_bits=<num> - Width of a reference count entry in bits
|
||||
@@ -621,6 +643,7 @@ Format specific information:
|
||||
lazy refcounts: true
|
||||
refcount bits: 16
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
Testing: amend -f qcow2 -o size=130M -o lazy_refcounts=off TEST_DIR/t.qcow2
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
@@ -633,6 +656,7 @@ Format specific information:
|
||||
lazy refcounts: false
|
||||
refcount bits: 16
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
Testing: amend -f qcow2 -o size=8M -o lazy_refcounts=on -o size=132M TEST_DIR/t.qcow2
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
@@ -645,6 +669,7 @@ Format specific information:
|
||||
lazy refcounts: true
|
||||
refcount bits: 16
|
||||
corrupt: false
|
||||
extended l2: false
|
||||
|
||||
Testing: amend -f qcow2 -o size=4M,size=148M TEST_DIR/t.qcow2
|
||||
image: TEST_DIR/t.IMGFMT
|
||||
|
||||
+19
-19
@@ -13,7 +13,7 @@ Formatting 'TEST_DIR/t.IMGFMT.2', fmt=IMGFMT size=134217728
|
||||
=== Create a single snapshot on virtio0 ===
|
||||
|
||||
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/1-snapshot-v0.IMGFMT', 'format': 'IMGFMT' } }
|
||||
Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2.1 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2.1 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
|
||||
=== Invalid command - missing device and nodename ===
|
||||
@@ -30,40 +30,40 @@ Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compress
|
||||
=== Create several transactional group snapshots ===
|
||||
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/2-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/2-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/1-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2.2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/1-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/t.qcow2.2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/3-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/3-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/2-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/2-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/2-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/2-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/4-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/4-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/3-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/3-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/3-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/3-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/5-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/5-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/4-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/4-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/4-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/4-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/6-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/6-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/5-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/5-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/5-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/5-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/7-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/7-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/6-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/6-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/6-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/6-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/8-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/8-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/7-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/7-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/7-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/7-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/9-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/9-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/8-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/8-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/8-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/8-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{ 'execute': 'transaction', 'arguments': {'actions': [ { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio0', 'snapshot-file': 'TEST_DIR/10-snapshot-v0.IMGFMT' } }, { 'type': 'blockdev-snapshot-sync', 'data' : { 'device': 'virtio1', 'snapshot-file': 'TEST_DIR/10-snapshot-v1.IMGFMT' } } ] } }
|
||||
Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/9-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=134217728 backing_file=TEST_DIR/9-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/9-snapshot-v0.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=134217728 backing_file=TEST_DIR/9-snapshot-v1.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
|
||||
=== Create a couple of snapshots using blockdev-snapshot ===
|
||||
|
||||
@@ -9,7 +9,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=536870912
|
||||
{ 'execute': 'qmp_capabilities' }
|
||||
{"return": {}}
|
||||
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp.IMGFMT', 'format': 'IMGFMT' } }
|
||||
Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
|
||||
=== Performing block-commit on active layer ===
|
||||
@@ -31,6 +31,6 @@ Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 cluster_size=65536 compression_type=z
|
||||
=== Performing Live Snapshot 2 ===
|
||||
|
||||
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp2.IMGFMT', 'format': 'IMGFMT' } }
|
||||
Formatting 'TEST_DIR/tmp2.qcow2', fmt=qcow2 cluster_size=65536 compression_type=zlib size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/tmp2.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
*** done
|
||||
|
||||
@@ -13,7 +13,7 @@ Is another process using the image [TEST_DIR/t.qcow2]?
|
||||
{'execute': 'blockdev-add', 'arguments': { 'node-name': 'node0', 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } }
|
||||
{"return": {}}
|
||||
{'execute': 'blockdev-snapshot-sync', 'arguments': { 'node-name': 'node0', 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'snapshot-node-name': 'node1' } }
|
||||
Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 cluster_size=65536 compression_type=zlib size=197120 backing_file=TEST_DIR/t.qcow2 backing_fmt=file lazy_refcounts=off refcount_bits=16
|
||||
Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=197120 backing_file=TEST_DIR/t.qcow2 backing_fmt=file lazy_refcounts=off refcount_bits=16
|
||||
{"return": {}}
|
||||
{'execute': 'blockdev-add', 'arguments': { 'node-name': 'node1', 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } }
|
||||
{"return": {}}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user