Block patches:

- zstd compression for qcow2
 - Fix use-after-free
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEkb62CjDbPohX0Rgp9AfbAGHVz0AFAl68AK4SHG1yZWl0ekBy
 ZWRoYXQuY29tAAoJEPQH2wBh1c9ApcwH/3Uyd9iv7+NPPRTD9WRDgpfk7BaNTwFw
 rCBQdC9LTnzBLP3Ra7PrvvOaiQ5M2BVe+McpeM3nhKURtMp6kmql5CCsK5JPbK9I
 yApT/ckj7wdIdQpe3sQnjbAyttK2TO+HKTv/56yFu8xHfpfpswUbx4DhpYeqbCcr
 CMp9VdIs19L+kGNdqDeDL5PVFFzJbre2W6rHYh/23TlqEXFN8p8ZKl0F0iG4D/vs
 fpjkBMG0nowlhF33B/MXWgJfi95JEYh62fb9HCKbngNFbS3TQhhfapUaTYbNHYU+
 dllqHNGdf87CW2WCdlhTGeMtQY/6qQPqvpdhrUTCQFsPUE0q/409WSs=
 =DQcu
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-05-13' into staging

Block patches:
- zstd compression for qcow2
- Fix use-after-free

# gpg: Signature made Wed 13 May 2020 15:14:06 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-05-13:
  block/block-copy: fix use-after-free of task pointer
  iotests: 287: add qcow2 compression type test
  qcow2: add zstd cluster compression
  qcow2: rework the cluster compression routine
  qcow2: introduce compression type feature

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-05-13 15:35:32 +01:00
commit d8f9d57dbd
30 changed files with 825 additions and 163 deletions

View File

@ -591,13 +591,13 @@ static int coroutine_fn block_copy_dirty_clusters(BlockCopyState *s,
} }
if (s->skip_unallocated && !(ret & BDRV_BLOCK_ALLOCATED)) { if (s->skip_unallocated && !(ret & BDRV_BLOCK_ALLOCATED)) {
block_copy_task_end(task, 0); block_copy_task_end(task, 0);
g_free(task);
progress_set_remaining(s->progress, progress_set_remaining(s->progress,
bdrv_get_dirty_count(s->copy_bitmap) + bdrv_get_dirty_count(s->copy_bitmap) +
s->in_flight_bytes); s->in_flight_bytes);
trace_block_copy_skip_range(s, task->offset, task->bytes); trace_block_copy_skip_range(s, task->offset, task->bytes);
offset = task_end(task); offset = task_end(task);
bytes = end - offset; bytes = end - offset;
g_free(task);
continue; continue;
} }
task->zeroes = ret & BDRV_BLOCK_ZERO; task->zeroes = ret & BDRV_BLOCK_ZERO;

View File

@ -28,6 +28,11 @@
#define ZLIB_CONST #define ZLIB_CONST
#include <zlib.h> #include <zlib.h>
#ifdef CONFIG_ZSTD
#include <zstd.h>
#include <zstd_errors.h>
#endif
#include "qcow2.h" #include "qcow2.h"
#include "block/thread-pool.h" #include "block/thread-pool.h"
#include "crypto.h" #include "crypto.h"
@ -74,7 +79,9 @@ typedef struct Qcow2CompressData {
} Qcow2CompressData; } Qcow2CompressData;
/* /*
* qcow2_compress() * qcow2_zlib_compress()
*
* Compress @src_size bytes of data using zlib compression method
* *
* @dest - destination buffer, @dest_size bytes * @dest - destination buffer, @dest_size bytes
* @src - source buffer, @src_size bytes * @src - source buffer, @src_size bytes
@ -83,7 +90,7 @@ typedef struct Qcow2CompressData {
* -ENOMEM destination buffer is not enough to store compressed data * -ENOMEM destination buffer is not enough to store compressed data
* -EIO on any other error * -EIO on any other error
*/ */
static ssize_t qcow2_compress(void *dest, size_t dest_size, static ssize_t qcow2_zlib_compress(void *dest, size_t dest_size,
const void *src, size_t src_size) const void *src, size_t src_size)
{ {
ssize_t ret; ssize_t ret;
@ -119,10 +126,10 @@ static ssize_t qcow2_compress(void *dest, size_t dest_size,
} }
/* /*
* qcow2_decompress() * qcow2_zlib_decompress()
* *
* Decompress some data (not more than @src_size bytes) to produce exactly * Decompress some data (not more than @src_size bytes) to produce exactly
* @dest_size bytes. * @dest_size bytes using zlib compression method
* *
* @dest - destination buffer, @dest_size bytes * @dest - destination buffer, @dest_size bytes
* @src - source buffer, @src_size bytes * @src - source buffer, @src_size bytes
@ -130,7 +137,7 @@ static ssize_t qcow2_compress(void *dest, size_t dest_size,
* Returns: 0 on success * Returns: 0 on success
* -EIO on fail * -EIO on fail
*/ */
static ssize_t qcow2_decompress(void *dest, size_t dest_size, static ssize_t qcow2_zlib_decompress(void *dest, size_t dest_size,
const void *src, size_t src_size) const void *src, size_t src_size)
{ {
int ret; int ret;
@ -164,6 +171,160 @@ static ssize_t qcow2_decompress(void *dest, size_t dest_size,
return ret; return ret;
} }
#ifdef CONFIG_ZSTD
/*
* qcow2_zstd_compress()
*
* Compress @src_size bytes of data using zstd compression method
*
* @dest - destination buffer, @dest_size bytes
* @src - source buffer, @src_size bytes
*
* Returns: compressed size on success
* -ENOMEM destination buffer is not enough to store compressed data
* -EIO on any other error
*/
static ssize_t qcow2_zstd_compress(void *dest, size_t dest_size,
const void *src, size_t src_size)
{
ssize_t ret;
size_t zstd_ret;
ZSTD_outBuffer output = {
.dst = dest,
.size = dest_size,
.pos = 0
};
ZSTD_inBuffer input = {
.src = src,
.size = src_size,
.pos = 0
};
ZSTD_CCtx *cctx = ZSTD_createCCtx();
if (!cctx) {
return -EIO;
}
/*
* Use the zstd streamed interface for symmetry with decompression,
* where streaming is essential since we don't record the exact
* compressed size.
*
* ZSTD_compressStream2() tries to compress everything it could
* with a single call. Although, ZSTD docs says that:
* "You must continue calling ZSTD_compressStream2() with ZSTD_e_end
* until it returns 0, at which point you are free to start a new frame",
* in out tests we saw the only case when it returned with >0 -
* when the output buffer was too small. In that case,
* ZSTD_compressStream2() expects a bigger buffer on the next call.
* We can't provide a bigger buffer because we are limited with dest_size
* which we pass to the ZSTD_compressStream2() at once.
* So, we don't need any loops and just abort the compression when we
* don't get 0 result on the first call.
*/
zstd_ret = ZSTD_compressStream2(cctx, &output, &input, ZSTD_e_end);
if (zstd_ret) {
if (zstd_ret > output.size - output.pos) {
ret = -ENOMEM;
} else {
ret = -EIO;
}
goto out;
}
/* make sure that zstd didn't overflow the dest buffer */
assert(output.pos <= dest_size);
ret = output.pos;
out:
ZSTD_freeCCtx(cctx);
return ret;
}
/*
* qcow2_zstd_decompress()
*
* Decompress some data (not more than @src_size bytes) to produce exactly
* @dest_size bytes using zstd compression method
*
* @dest - destination buffer, @dest_size bytes
* @src - source buffer, @src_size bytes
*
* Returns: 0 on success
* -EIO on any error
*/
static ssize_t qcow2_zstd_decompress(void *dest, size_t dest_size,
const void *src, size_t src_size)
{
size_t zstd_ret = 0;
ssize_t ret = 0;
ZSTD_outBuffer output = {
.dst = dest,
.size = dest_size,
.pos = 0
};
ZSTD_inBuffer input = {
.src = src,
.size = src_size,
.pos = 0
};
ZSTD_DCtx *dctx = ZSTD_createDCtx();
if (!dctx) {
return -EIO;
}
/*
* The compressed stream from the input buffer may consist of more
* than one zstd frame. So we iterate until we get a fully
* uncompressed cluster.
* From zstd docs related to ZSTD_decompressStream:
* "return : 0 when a frame is completely decoded and fully flushed"
* We suppose that this means: each time ZSTD_decompressStream reads
* only ONE full frame and returns 0 if and only if that frame
* is completely decoded and flushed. Only after returning 0,
* ZSTD_decompressStream reads another ONE full frame.
*/
while (output.pos < output.size) {
size_t last_in_pos = input.pos;
size_t last_out_pos = output.pos;
zstd_ret = ZSTD_decompressStream(dctx, &output, &input);
if (ZSTD_isError(zstd_ret)) {
ret = -EIO;
break;
}
/*
* The ZSTD manual is vague about what to do if it reads
* the buffer partially, and we don't want to get stuck
* in an infinite loop where ZSTD_decompressStream
* returns > 0 waiting for another input chunk. So, we add
* a check which ensures that the loop makes some progress
* on each step.
*/
if (last_in_pos >= input.pos &&
last_out_pos >= output.pos) {
ret = -EIO;
break;
}
}
/*
* Make sure that we have the frame fully flushed here
* if not, we somehow managed to get uncompressed cluster
* greater then the cluster size, possibly because of its
* damage.
*/
if (zstd_ret > 0) {
ret = -EIO;
}
ZSTD_freeDCtx(dctx);
assert(ret == 0 || ret == -EIO);
return ret;
}
#endif
static int qcow2_compress_pool_func(void *opaque) static int qcow2_compress_pool_func(void *opaque)
{ {
Qcow2CompressData *data = opaque; Qcow2CompressData *data = opaque;
@ -191,20 +352,77 @@ qcow2_co_do_compress(BlockDriverState *bs, void *dest, size_t dest_size,
return arg.ret; return arg.ret;
} }
/*
* qcow2_co_compress()
*
* Compress @src_size bytes of data using the compression
* method defined by the image compression type
*
* @dest - destination buffer, @dest_size bytes
* @src - source buffer, @src_size bytes
*
* Returns: compressed size on success
* a negative error code on failure
*/
ssize_t coroutine_fn ssize_t coroutine_fn
qcow2_co_compress(BlockDriverState *bs, void *dest, size_t dest_size, qcow2_co_compress(BlockDriverState *bs, void *dest, size_t dest_size,
const void *src, size_t src_size) const void *src, size_t src_size)
{ {
return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, BDRVQcow2State *s = bs->opaque;
qcow2_compress); Qcow2CompressFunc fn;
switch (s->compression_type) {
case QCOW2_COMPRESSION_TYPE_ZLIB:
fn = qcow2_zlib_compress;
break;
#ifdef CONFIG_ZSTD
case QCOW2_COMPRESSION_TYPE_ZSTD:
fn = qcow2_zstd_compress;
break;
#endif
default:
abort();
}
return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, fn);
} }
/*
* qcow2_co_decompress()
*
* Decompress some data (not more than @src_size bytes) to produce exactly
* @dest_size bytes using the compression method defined by the image
* compression type
*
* @dest - destination buffer, @dest_size bytes
* @src - source buffer, @src_size bytes
*
* Returns: 0 on success
* a negative error code on failure
*/
ssize_t coroutine_fn ssize_t coroutine_fn
qcow2_co_decompress(BlockDriverState *bs, void *dest, size_t dest_size, qcow2_co_decompress(BlockDriverState *bs, void *dest, size_t dest_size,
const void *src, size_t src_size) const void *src, size_t src_size)
{ {
return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, BDRVQcow2State *s = bs->opaque;
qcow2_decompress); Qcow2CompressFunc fn;
switch (s->compression_type) {
case QCOW2_COMPRESSION_TYPE_ZLIB:
fn = qcow2_zlib_decompress;
break;
#ifdef CONFIG_ZSTD
case QCOW2_COMPRESSION_TYPE_ZSTD:
fn = qcow2_zstd_decompress;
break;
#endif
default:
abort();
}
return qcow2_co_do_compress(bs, dest, dest_size, src, src_size, fn);
} }

View File

@ -1242,6 +1242,42 @@ static int qcow2_update_options(BlockDriverState *bs, QDict *options,
return ret; return ret;
} }
static int validate_compression_type(BDRVQcow2State *s, Error **errp)
{
switch (s->compression_type) {
case QCOW2_COMPRESSION_TYPE_ZLIB:
#ifdef CONFIG_ZSTD
case QCOW2_COMPRESSION_TYPE_ZSTD:
#endif
break;
default:
error_setg(errp, "qcow2: unknown compression type: %u",
s->compression_type);
return -ENOTSUP;
}
/*
* if the compression type differs from QCOW2_COMPRESSION_TYPE_ZLIB
* the incompatible feature flag must be set
*/
if (s->compression_type == QCOW2_COMPRESSION_TYPE_ZLIB) {
if (s->incompatible_features & QCOW2_INCOMPAT_COMPRESSION) {
error_setg(errp, "qcow2: Compression type incompatible feature "
"bit must not be set");
return -EINVAL;
}
} else {
if (!(s->incompatible_features & QCOW2_INCOMPAT_COMPRESSION)) {
error_setg(errp, "qcow2: Compression type incompatible feature "
"bit must be set");
return -EINVAL;
}
}
return 0;
}
/* Called with s->lock held. */ /* Called with s->lock held. */
static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
int flags, Error **errp) int flags, Error **errp)
@ -1357,6 +1393,23 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
s->compatible_features = header.compatible_features; s->compatible_features = header.compatible_features;
s->autoclear_features = header.autoclear_features; s->autoclear_features = header.autoclear_features;
/*
* Handle compression type
* Older qcow2 images don't contain the compression type header.
* Distinguish them by the header length and use
* the only valid (default) compression type in that case
*/
if (header.header_length > offsetof(QCowHeader, compression_type)) {
s->compression_type = header.compression_type;
} else {
s->compression_type = QCOW2_COMPRESSION_TYPE_ZLIB;
}
ret = validate_compression_type(s, errp);
if (ret) {
goto fail;
}
if (s->incompatible_features & ~QCOW2_INCOMPAT_MASK) { if (s->incompatible_features & ~QCOW2_INCOMPAT_MASK) {
void *feature_table = NULL; void *feature_table = NULL;
qcow2_read_extensions(bs, header.header_length, ext_end, qcow2_read_extensions(bs, header.header_length, ext_end,
@ -2728,6 +2781,11 @@ int qcow2_update_header(BlockDriverState *bs)
total_size = bs->total_sectors * BDRV_SECTOR_SIZE; total_size = bs->total_sectors * BDRV_SECTOR_SIZE;
refcount_table_clusters = s->refcount_table_size >> (s->cluster_bits - 3); refcount_table_clusters = s->refcount_table_size >> (s->cluster_bits - 3);
ret = validate_compression_type(s, NULL);
if (ret) {
goto fail;
}
*header = (QCowHeader) { *header = (QCowHeader) {
/* Version 2 fields */ /* Version 2 fields */
.magic = cpu_to_be32(QCOW_MAGIC), .magic = cpu_to_be32(QCOW_MAGIC),
@ -2750,6 +2808,7 @@ int qcow2_update_header(BlockDriverState *bs)
.autoclear_features = cpu_to_be64(s->autoclear_features), .autoclear_features = cpu_to_be64(s->autoclear_features),
.refcount_order = cpu_to_be32(s->refcount_order), .refcount_order = cpu_to_be32(s->refcount_order),
.header_length = cpu_to_be32(header_length), .header_length = cpu_to_be32(header_length),
.compression_type = s->compression_type,
}; };
/* For older versions, write a shorter header */ /* For older versions, write a shorter header */
@ -2849,6 +2908,11 @@ int qcow2_update_header(BlockDriverState *bs)
.bit = QCOW2_INCOMPAT_DATA_FILE_BITNR, .bit = QCOW2_INCOMPAT_DATA_FILE_BITNR,
.name = "external data file", .name = "external data file",
}, },
{
.type = QCOW2_FEAT_TYPE_INCOMPATIBLE,
.bit = QCOW2_INCOMPAT_COMPRESSION_BITNR,
.name = "compression type",
},
{ {
.type = QCOW2_FEAT_TYPE_COMPATIBLE, .type = QCOW2_FEAT_TYPE_COMPATIBLE,
.bit = QCOW2_COMPAT_LAZY_REFCOUNTS_BITNR, .bit = QCOW2_COMPAT_LAZY_REFCOUNTS_BITNR,
@ -3287,6 +3351,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
uint64_t* refcount_table; uint64_t* refcount_table;
Error *local_err = NULL; Error *local_err = NULL;
int ret; int ret;
uint8_t compression_type = QCOW2_COMPRESSION_TYPE_ZLIB;
assert(create_options->driver == BLOCKDEV_DRIVER_QCOW2); assert(create_options->driver == BLOCKDEV_DRIVER_QCOW2);
qcow2_opts = &create_options->u.qcow2; qcow2_opts = &create_options->u.qcow2;
@ -3404,6 +3469,31 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
} }
} }
if (qcow2_opts->has_compression_type &&
qcow2_opts->compression_type != QCOW2_COMPRESSION_TYPE_ZLIB) {
ret = -EINVAL;
if (version < 3) {
error_setg(errp, "Non-zlib compression type is only supported with "
"compatibility level 1.1 and above (use version=v3 or "
"greater)");
goto out;
}
switch (qcow2_opts->compression_type) {
#ifdef CONFIG_ZSTD
case QCOW2_COMPRESSION_TYPE_ZSTD:
break;
#endif
default:
error_setg(errp, "Unknown compression type");
goto out;
}
compression_type = qcow2_opts->compression_type;
}
/* Create BlockBackend to write to the image */ /* Create BlockBackend to write to the image */
blk = blk_new_with_bs(bs, BLK_PERM_WRITE | BLK_PERM_RESIZE, BLK_PERM_ALL, blk = blk_new_with_bs(bs, BLK_PERM_WRITE | BLK_PERM_RESIZE, BLK_PERM_ALL,
errp); errp);
@ -3426,6 +3516,8 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
.refcount_table_offset = cpu_to_be64(cluster_size), .refcount_table_offset = cpu_to_be64(cluster_size),
.refcount_table_clusters = cpu_to_be32(1), .refcount_table_clusters = cpu_to_be32(1),
.refcount_order = cpu_to_be32(refcount_order), .refcount_order = cpu_to_be32(refcount_order),
/* don't deal with endianness since compression_type is 1 byte long */
.compression_type = compression_type,
.header_length = cpu_to_be32(sizeof(*header)), .header_length = cpu_to_be32(sizeof(*header)),
}; };
@ -3444,6 +3536,10 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp)
header->autoclear_features |= header->autoclear_features |=
cpu_to_be64(QCOW2_AUTOCLEAR_DATA_FILE_RAW); cpu_to_be64(QCOW2_AUTOCLEAR_DATA_FILE_RAW);
} }
if (compression_type != QCOW2_COMPRESSION_TYPE_ZLIB) {
header->incompatible_features |=
cpu_to_be64(QCOW2_INCOMPAT_COMPRESSION);
}
ret = blk_pwrite(blk, 0, header, cluster_size, 0); ret = blk_pwrite(blk, 0, header, cluster_size, 0);
g_free(header); g_free(header);
@ -3629,6 +3725,7 @@ static int coroutine_fn qcow2_co_create_opts(BlockDriver *drv,
{ BLOCK_OPT_ENCRYPT, BLOCK_OPT_ENCRYPT_FORMAT }, { BLOCK_OPT_ENCRYPT, BLOCK_OPT_ENCRYPT_FORMAT },
{ BLOCK_OPT_COMPAT_LEVEL, "version" }, { BLOCK_OPT_COMPAT_LEVEL, "version" },
{ BLOCK_OPT_DATA_FILE_RAW, "data-file-raw" }, { BLOCK_OPT_DATA_FILE_RAW, "data-file-raw" },
{ BLOCK_OPT_COMPRESSION_TYPE, "compression-type" },
{ NULL, NULL }, { NULL, NULL },
}; };
@ -4925,6 +5022,7 @@ static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs,
.data_file = g_strdup(s->image_data_file), .data_file = g_strdup(s->image_data_file),
.has_data_file_raw = has_data_file(bs), .has_data_file_raw = has_data_file(bs),
.data_file_raw = data_file_is_raw(bs), .data_file_raw = data_file_is_raw(bs),
.compression_type = s->compression_type,
}; };
} else { } else {
/* if this assertion fails, this probably means a new version was /* if this assertion fails, this probably means a new version was
@ -5330,6 +5428,22 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
"images"); "images");
return -EINVAL; return -EINVAL;
} }
} else if (!strcmp(desc->name, BLOCK_OPT_COMPRESSION_TYPE)) {
const char *ct_name =
qemu_opt_get(opts, BLOCK_OPT_COMPRESSION_TYPE);
int compression_type =
qapi_enum_parse(&Qcow2CompressionType_lookup, ct_name, -1,
NULL);
if (compression_type == -1) {
error_setg(errp, "Unknown compression type: %s", ct_name);
return -ENOTSUP;
}
if (compression_type != s->compression_type) {
error_setg(errp, "Changing the compression type "
"is not supported");
return -ENOTSUP;
}
} else { } else {
/* if this point is reached, this probably means a new option was /* if this point is reached, this probably means a new option was
* added without having it covered here */ * added without having it covered here */
@ -5596,6 +5710,12 @@ static QemuOptsList qcow2_create_opts = {
.help = "Width of a reference count entry in bits", .help = "Width of a reference count entry in bits",
.def_value_str = "16" .def_value_str = "16"
}, },
{
.name = BLOCK_OPT_COMPRESSION_TYPE,
.type = QEMU_OPT_STRING,
.help = "Compression method used for image cluster compression",
.def_value_str = "zlib"
},
{ /* end of list */ } { /* end of list */ }
} }
}; };

View File

@ -146,8 +146,16 @@ typedef struct QCowHeader {
uint32_t refcount_order; uint32_t refcount_order;
uint32_t header_length; uint32_t header_length;
/* Additional fields */
uint8_t compression_type;
/* header must be a multiple of 8 */
uint8_t padding[7];
} QEMU_PACKED QCowHeader; } QEMU_PACKED QCowHeader;
QEMU_BUILD_BUG_ON(!QEMU_IS_ALIGNED(sizeof(QCowHeader), 8));
typedef struct QEMU_PACKED QCowSnapshotHeader { typedef struct QEMU_PACKED QCowSnapshotHeader {
/* header is 8 byte aligned */ /* header is 8 byte aligned */
uint64_t l1_table_offset; uint64_t l1_table_offset;
@ -216,13 +224,16 @@ enum {
QCOW2_INCOMPAT_DIRTY_BITNR = 0, QCOW2_INCOMPAT_DIRTY_BITNR = 0,
QCOW2_INCOMPAT_CORRUPT_BITNR = 1, QCOW2_INCOMPAT_CORRUPT_BITNR = 1,
QCOW2_INCOMPAT_DATA_FILE_BITNR = 2, QCOW2_INCOMPAT_DATA_FILE_BITNR = 2,
QCOW2_INCOMPAT_COMPRESSION_BITNR = 3,
QCOW2_INCOMPAT_DIRTY = 1 << QCOW2_INCOMPAT_DIRTY_BITNR, QCOW2_INCOMPAT_DIRTY = 1 << QCOW2_INCOMPAT_DIRTY_BITNR,
QCOW2_INCOMPAT_CORRUPT = 1 << QCOW2_INCOMPAT_CORRUPT_BITNR, QCOW2_INCOMPAT_CORRUPT = 1 << QCOW2_INCOMPAT_CORRUPT_BITNR,
QCOW2_INCOMPAT_DATA_FILE = 1 << QCOW2_INCOMPAT_DATA_FILE_BITNR, QCOW2_INCOMPAT_DATA_FILE = 1 << QCOW2_INCOMPAT_DATA_FILE_BITNR,
QCOW2_INCOMPAT_COMPRESSION = 1 << QCOW2_INCOMPAT_COMPRESSION_BITNR,
QCOW2_INCOMPAT_MASK = QCOW2_INCOMPAT_DIRTY QCOW2_INCOMPAT_MASK = QCOW2_INCOMPAT_DIRTY
| QCOW2_INCOMPAT_CORRUPT | QCOW2_INCOMPAT_CORRUPT
| QCOW2_INCOMPAT_DATA_FILE, | QCOW2_INCOMPAT_DATA_FILE
| QCOW2_INCOMPAT_COMPRESSION,
}; };
/* Compatible feature bits */ /* Compatible feature bits */
@ -366,6 +377,13 @@ typedef struct BDRVQcow2State {
bool metadata_preallocation_checked; bool metadata_preallocation_checked;
bool metadata_preallocation; bool metadata_preallocation;
/*
* Compression type used for the image. Default: 0 - ZLIB
* The image compression type is set on image creation.
* For now, the only way to change the compression type
* is to convert the image with the desired compression type set.
*/
Qcow2CompressionType compression_type;
} BDRVQcow2State; } BDRVQcow2State;
typedef struct Qcow2COWRegion { typedef struct Qcow2COWRegion {

2
configure vendored
View File

@ -1861,7 +1861,7 @@ disabled with --disable-FEATURE, default is enabled if available:
lzfse support of lzfse compression library lzfse support of lzfse compression library
(for reading lzfse-compressed dmg images) (for reading lzfse-compressed dmg images)
zstd support for zstd compression library zstd support for zstd compression library
(for migration compression) (for migration compression and qcow2 cluster compression)
seccomp seccomp support seccomp seccomp support
coroutine-pool coroutine freelist (better performance) coroutine-pool coroutine freelist (better performance)
glusterfs GlusterFS backend glusterfs GlusterFS backend

View File

@ -212,6 +212,7 @@ version 2.
Available compression type values: Available compression type values:
0: zlib <https://www.zlib.net/> 0: zlib <https://www.zlib.net/>
1: zstd <http://github.com/facebook/zstd>
=== Header padding === === Header padding ===

View File

@ -57,6 +57,7 @@
#define BLOCK_OPT_REFCOUNT_BITS "refcount_bits" #define BLOCK_OPT_REFCOUNT_BITS "refcount_bits"
#define BLOCK_OPT_DATA_FILE "data_file" #define BLOCK_OPT_DATA_FILE "data_file"
#define BLOCK_OPT_DATA_FILE_RAW "data_file_raw" #define BLOCK_OPT_DATA_FILE_RAW "data_file_raw"
#define BLOCK_OPT_COMPRESSION_TYPE "compression_type"
#define BLOCK_PROBE_BUF_SIZE 512 #define BLOCK_PROBE_BUF_SIZE 512

View File

@ -78,6 +78,8 @@
# #
# @bitmaps: A list of qcow2 bitmap details (since 4.0) # @bitmaps: A list of qcow2 bitmap details (since 4.0)
# #
# @compression-type: the image cluster compression method (since 5.1)
#
# Since: 1.7 # Since: 1.7
## ##
{ 'struct': 'ImageInfoSpecificQCow2', { 'struct': 'ImageInfoSpecificQCow2',
@ -89,7 +91,8 @@
'*corrupt': 'bool', '*corrupt': 'bool',
'refcount-bits': 'int', 'refcount-bits': 'int',
'*encrypt': 'ImageInfoSpecificQCow2Encryption', '*encrypt': 'ImageInfoSpecificQCow2Encryption',
'*bitmaps': ['Qcow2BitmapInfo'] '*bitmaps': ['Qcow2BitmapInfo'],
'compression-type': 'Qcow2CompressionType'
} } } }
## ##
@ -4284,6 +4287,19 @@
'data': [ 'v2', 'v3' ] } 'data': [ 'v2', 'v3' ] }
##
# @Qcow2CompressionType:
#
# Compression type used in qcow2 image file
#
# @zlib: zlib compression, see <http://zlib.net/>
# @zstd: zstd compression, see <http://github.com/facebook/zstd>
#
# Since: 5.1
##
{ 'enum': 'Qcow2CompressionType',
'data': [ 'zlib', { 'name': 'zstd', 'if': 'defined(CONFIG_ZSTD)' } ] }
## ##
# @BlockdevCreateOptionsQcow2: # @BlockdevCreateOptionsQcow2:
# #
@ -4307,6 +4323,8 @@
# allowed values: off, falloc, full, metadata) # allowed values: off, falloc, full, metadata)
# @lazy-refcounts: True if refcounts may be updated lazily (default: off) # @lazy-refcounts: True if refcounts may be updated lazily (default: off)
# @refcount-bits: Width of reference counts in bits (default: 16) # @refcount-bits: Width of reference counts in bits (default: 16)
# @compression-type: The image cluster compression method
# (default: zlib, since 5.1)
# #
# Since: 2.12 # Since: 2.12
## ##
@ -4322,7 +4340,8 @@
'*cluster-size': 'size', '*cluster-size': 'size',
'*preallocation': 'PreallocMode', '*preallocation': 'PreallocMode',
'*lazy-refcounts': 'bool', '*lazy-refcounts': 'bool',
'*refcount-bits': 'int' } } '*refcount-bits': 'int',
'*compression-type':'Qcow2CompressionType' } }
## ##
# @BlockdevCreateOptionsQed: # @BlockdevCreateOptionsQed:

View File

@ -113,11 +113,11 @@ incompatible_features []
compatible_features [] compatible_features []
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
Header extension: Header extension:
@ -146,11 +146,11 @@ incompatible_features []
compatible_features [] compatible_features []
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
Header extension: Header extension:
@ -164,7 +164,7 @@ No errors were found on the image.
magic 0x514649fb magic 0x514649fb
version 3 version 3
backing_file_offset 0x1d8 backing_file_offset 0x210
backing_file_size 0x17 backing_file_size 0x17
cluster_bits 16 cluster_bits 16
size 67108864 size 67108864
@ -179,7 +179,7 @@ incompatible_features []
compatible_features [] compatible_features []
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0xe2792aca magic 0xe2792aca
@ -188,7 +188,7 @@ data 'host_device'
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
Header extension: Header extension:

View File

@ -26,7 +26,7 @@ compatible_features []
autoclear_features [63] autoclear_features [63]
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
@ -38,7 +38,7 @@ compatible_features []
autoclear_features [] autoclear_features []
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
*** done *** done

View File

@ -4,90 +4,90 @@ QA output created by 049
== 1. Traditional size parameter == == 1. Traditional size parameter ==
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024b qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024b
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1k qemu-img create -f qcow2 TEST_DIR/t.qcow2 1k
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1K qemu-img create -f qcow2 TEST_DIR/t.qcow2 1K
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1M qemu-img create -f qcow2 TEST_DIR/t.qcow2 1M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1G qemu-img create -f qcow2 TEST_DIR/t.qcow2 1G
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1T qemu-img create -f qcow2 TEST_DIR/t.qcow2 1T
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0 qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0b qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0b
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5k qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5k
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5K qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5K
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5M qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5G qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5G
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5T qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5T
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
== 2. Specifying size via -o == == 2. Specifying size via -o ==
qemu-img create -f qcow2 -o size=1024 TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1024 TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1024b TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1024b TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1k TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1k TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1K TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1K TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1M TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1M TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1G TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1G TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1T TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1T TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1024.0 TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1024.0 TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1024.0b TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1024.0b TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1.5k TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1.5k TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1.5K TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1.5K TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1.5M TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1.5M TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1.5G TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1.5G TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o size=1.5T TEST_DIR/t.qcow2 qemu-img create -f qcow2 -o size=1.5T TEST_DIR/t.qcow2
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
== 3. Invalid sizes == == 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 == == Check correct interpretation of suffixes for cluster size ==
qemu-img create -f qcow2 -o cluster_size=1024 TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=1024 TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=1024b TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=1024b TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=1k TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=1k TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=1K TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=1K TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=1M TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=1M TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1048576 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1048576 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=1024.0 TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=1024.0 TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=1024.0b TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=1024.0b TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=0.5k TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=0.5k TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=0.5K TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=0.5K TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o cluster_size=0.5M TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o cluster_size=0.5M TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=524288 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=524288 lazy_refcounts=off refcount_bits=16 compression_type=zlib
== Check compat level option == == Check compat level option ==
qemu-img create -f qcow2 -o compat=0.10 TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=0.10 TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o compat=1.1 TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=1.1 TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o compat=0.42 TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=0.42 TEST_DIR/t.qcow2 64M
qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42' qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.42 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.42 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o compat=foobar TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=foobar TEST_DIR/t.qcow2 64M
qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar' qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=foobar cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=foobar cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
== Check preallocation option == == Check preallocation option ==
qemu-img create -f qcow2 -o preallocation=off TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o preallocation=off TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=off lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=off lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o preallocation=metadata TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o preallocation=metadata TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o preallocation=1234 TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o preallocation=1234 TEST_DIR/t.qcow2 64M
qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234' qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=1234 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=1234 lazy_refcounts=off refcount_bits=16 compression_type=zlib
== Check encryption option == == Check encryption option ==
qemu-img create -f qcow2 -o encryption=off TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o encryption=off TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 --object secret,id=sec0,data=123456 -o encryption=on,encrypt.key-secret=sec0 TEST_DIR/t.qcow2 64M 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 size=67108864 encryption=on encrypt.key-secret=sec0 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=on encrypt.key-secret=sec0 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
== Check lazy_refcounts option (only with v3) == == Check lazy_refcounts option (only with v3) ==
qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=off TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=off TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=on TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=on TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=on refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=on refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=off TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=off TEST_DIR/t.qcow2 64M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=on TEST_DIR/t.qcow2 64M qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=on TEST_DIR/t.qcow2 64M
qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater) qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=on refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=on refcount_bits=16 compression_type=zlib
*** done *** done

View File

@ -17,6 +17,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: true corrupt: true

View File

@ -22,11 +22,11 @@ incompatible_features []
compatible_features [0] compatible_features [0]
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
magic 0x514649fb magic 0x514649fb
@ -80,11 +80,11 @@ incompatible_features []
compatible_features [0] compatible_features [0]
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
magic 0x514649fb magic 0x514649fb
@ -136,11 +136,11 @@ incompatible_features [0]
compatible_features [0] compatible_features [0]
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
ERROR cluster 5 refcount=0 reference=1 ERROR cluster 5 refcount=0 reference=1
@ -191,11 +191,11 @@ incompatible_features []
compatible_features [42] compatible_features [42]
autoclear_features [42] autoclear_features [42]
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
magic 0x514649fb magic 0x514649fb
@ -260,11 +260,11 @@ incompatible_features []
compatible_features [0] compatible_features [0]
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
read 65536/65536 bytes at offset 44040192 read 65536/65536 bytes at offset 44040192
@ -322,11 +322,11 @@ incompatible_features [0]
compatible_features [0] compatible_features [0]
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
ERROR cluster 5 refcount=0 reference=1 ERROR cluster 5 refcount=0 reference=1
@ -351,11 +351,11 @@ incompatible_features []
compatible_features [] compatible_features []
autoclear_features [] autoclear_features []
refcount_order 4 refcount_order 4
header_length 104 header_length 112
Header extension: Header extension:
magic 0x6803f857 magic 0x6803f857
length 288 length 336
data <binary> data <binary>
read 131072/131072 bytes at offset 0 read 131072/131072 bytes at offset 0
@ -519,6 +519,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
data file: TEST_DIR/t.IMGFMT.data data file: TEST_DIR/t.IMGFMT.data
@ -539,6 +540,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
data file: foo data file: foo
@ -552,6 +554,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
data file raw: false data file raw: false
@ -566,6 +569,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
data file: TEST_DIR/t.IMGFMT.data data file: TEST_DIR/t.IMGFMT.data
@ -578,6 +582,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
data file: TEST_DIR/t.IMGFMT.data data file: TEST_DIR/t.IMGFMT.data
@ -591,6 +596,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
data file: TEST_DIR/t.IMGFMT.data data file: TEST_DIR/t.IMGFMT.data

View File

@ -88,24 +88,30 @@ class TestQMP(TestImageInfoSpecific):
class TestQCow2(TestQemuImgInfo): class TestQCow2(TestQemuImgInfo):
'''Testing a qcow2 version 2 image''' '''Testing a qcow2 version 2 image'''
img_options = 'compat=0.10' img_options = 'compat=0.10'
json_compare = { 'compat': '0.10', 'refcount-bits': 16 } json_compare = { 'compat': '0.10', 'refcount-bits': 16,
human_compare = [ 'compat: 0.10', 'refcount bits: 16' ] 'compression-type': 'zlib' }
human_compare = [ 'compat: 0.10', 'compression type: zlib',
'refcount bits: 16' ]
class TestQCow3NotLazy(TestQemuImgInfo): class TestQCow3NotLazy(TestQemuImgInfo):
'''Testing a qcow2 version 3 image with lazy refcounts disabled''' '''Testing a qcow2 version 3 image with lazy refcounts disabled'''
img_options = 'compat=1.1,lazy_refcounts=off' img_options = 'compat=1.1,lazy_refcounts=off'
json_compare = { 'compat': '1.1', 'lazy-refcounts': False, json_compare = { 'compat': '1.1', 'lazy-refcounts': False,
'refcount-bits': 16, 'corrupt': False } 'refcount-bits': 16, 'corrupt': False,
human_compare = [ 'compat: 1.1', 'lazy refcounts: false', 'compression-type': 'zlib' }
'refcount bits: 16', 'corrupt: false' ] human_compare = [ 'compat: 1.1', 'compression type: zlib',
'lazy refcounts: false', 'refcount bits: 16',
'corrupt: false' ]
class TestQCow3Lazy(TestQemuImgInfo): class TestQCow3Lazy(TestQemuImgInfo):
'''Testing a qcow2 version 3 image with lazy refcounts enabled''' '''Testing a qcow2 version 3 image with lazy refcounts enabled'''
img_options = 'compat=1.1,lazy_refcounts=on' img_options = 'compat=1.1,lazy_refcounts=on'
json_compare = { 'compat': '1.1', 'lazy-refcounts': True, json_compare = { 'compat': '1.1', 'lazy-refcounts': True,
'refcount-bits': 16, 'corrupt': False } 'refcount-bits': 16, 'corrupt': False,
human_compare = [ 'compat: 1.1', 'lazy refcounts: true', 'compression-type': 'zlib' }
'refcount bits: 16', 'corrupt: false' ] human_compare = [ 'compat: 1.1', 'compression type: zlib',
'lazy refcounts: true', 'refcount bits: 16',
'corrupt: false' ]
class TestQCow3NotLazyQMP(TestQMP): class TestQCow3NotLazyQMP(TestQMP):
'''Testing a qcow2 version 3 image with lazy refcounts disabled, opening '''Testing a qcow2 version 3 image with lazy refcounts disabled, opening
@ -113,7 +119,8 @@ class TestQCow3NotLazyQMP(TestQMP):
img_options = 'compat=1.1,lazy_refcounts=off' img_options = 'compat=1.1,lazy_refcounts=off'
qemu_options = 'lazy-refcounts=on' qemu_options = 'lazy-refcounts=on'
compare = { 'compat': '1.1', 'lazy-refcounts': False, compare = { 'compat': '1.1', 'lazy-refcounts': False,
'refcount-bits': 16, 'corrupt': False } 'refcount-bits': 16, 'corrupt': False,
'compression-type': 'zlib' }
class TestQCow3LazyQMP(TestQMP): class TestQCow3LazyQMP(TestQMP):
@ -122,7 +129,8 @@ class TestQCow3LazyQMP(TestQMP):
img_options = 'compat=1.1,lazy_refcounts=on' img_options = 'compat=1.1,lazy_refcounts=on'
qemu_options = 'lazy-refcounts=off' qemu_options = 'lazy-refcounts=off'
compare = { 'compat': '1.1', 'lazy-refcounts': True, compare = { 'compat': '1.1', 'lazy-refcounts': True,
'refcount-bits': 16, 'corrupt': False } 'refcount-bits': 16, 'corrupt': False,
'compression-type': 'zlib' }
TestImageInfoSpecific = None TestImageInfoSpecific = None
TestQemuImgInfo = None TestQemuImgInfo = None

View File

@ -45,7 +45,7 @@ _supported_os Linux
# - This is generally a test for compat=1.1 images # - This is generally a test for compat=1.1 images
_unsupported_imgopts 'refcount_bits=1[^0-9]' data_file 'compat=0.10' _unsupported_imgopts 'refcount_bits=1[^0-9]' data_file 'compat=0.10'
header_size=104 header_size=112
offset_backing_file_offset=8 offset_backing_file_offset=8
offset_backing_file_size=16 offset_backing_file_size=16

View File

@ -3,38 +3,40 @@ QA output created by 082
=== create: Options specified more than once === === create: Options specified more than once ===
Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
image: TEST_DIR/t.IMGFMT image: TEST_DIR/t.IMGFMT
file format: IMGFMT file format: IMGFMT
virtual size: 128 MiB (134217728 bytes) virtual size: 128 MiB (134217728 bytes)
cluster_size: 65536 cluster_size: 65536
Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 128M Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=4096 lazy_refcounts=on refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=4096 lazy_refcounts=on refcount_bits=16 compression_type=zlib
image: TEST_DIR/t.IMGFMT image: TEST_DIR/t.IMGFMT
file format: IMGFMT file format: IMGFMT
virtual size: 128 MiB (134217728 bytes) virtual size: 128 MiB (134217728 bytes)
cluster_size: 4096 cluster_size: 4096
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: true lazy refcounts: true
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 128M 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 size=134217728 cluster_size=8192 lazy_refcounts=on refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=on refcount_bits=16 compression_type=zlib
image: TEST_DIR/t.IMGFMT image: TEST_DIR/t.IMGFMT
file format: IMGFMT file format: IMGFMT
virtual size: 128 MiB (134217728 bytes) virtual size: 128 MiB (134217728 bytes)
cluster_size: 8192 cluster_size: 8192
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: true lazy refcounts: true
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
Testing: create -f qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 128M Testing: create -f qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=off refcount_bits=16 compression_type=zlib
image: TEST_DIR/t.IMGFMT image: TEST_DIR/t.IMGFMT
file format: IMGFMT file format: IMGFMT
virtual size: 128 MiB (134217728 bytes) virtual size: 128 MiB (134217728 bytes)
@ -48,6 +50,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -71,6 +74,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -94,6 +98,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -117,6 +122,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -140,6 +146,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -163,6 +170,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -186,6 +194,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -209,6 +218,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -227,10 +237,10 @@ Supported options:
size=<size> - Virtual disk size size=<size> - Virtual disk size
Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 128M Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,help cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,help cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 128M Testing: create -f qcow2 -u -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,? cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2,,? cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 128M 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, qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2,
@ -247,6 +257,7 @@ Supported qcow2 options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -279,7 +290,7 @@ qemu-img: Format driver 'bochs' does not support image creation
=== convert: Options specified more than once === === convert: Options specified more than once ===
Testing: create -f qcow2 TEST_DIR/t.qcow2 128M Testing: create -f qcow2 TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
image: TEST_DIR/t.IMGFMT.base image: TEST_DIR/t.IMGFMT.base
@ -299,6 +310,7 @@ virtual size: 128 MiB (134217728 bytes)
cluster_size: 4096 cluster_size: 4096
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: true lazy refcounts: true
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -310,6 +322,7 @@ virtual size: 128 MiB (134217728 bytes)
cluster_size: 8192 cluster_size: 8192
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: true lazy refcounts: true
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -328,6 +341,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -351,6 +365,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -374,6 +389,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -397,6 +413,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -420,6 +437,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -443,6 +461,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -466,6 +485,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -489,6 +509,7 @@ Supported options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -527,6 +548,7 @@ Supported qcow2 options:
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -579,6 +601,7 @@ virtual size: 128 MiB (134217728 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: true lazy refcounts: true
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -590,6 +613,7 @@ virtual size: 130 MiB (136314880 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -601,6 +625,7 @@ virtual size: 132 MiB (138412032 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: true lazy refcounts: true
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -619,6 +644,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -643,6 +669,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -667,6 +694,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -691,6 +719,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -715,6 +744,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -739,6 +769,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -763,6 +794,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -787,6 +819,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm
@ -828,6 +861,7 @@ Creation options for 'qcow2':
backing_fmt=<str> - Image format of the base image backing_fmt=<str> - Image format of the base image
cluster_size=<size> - qcow2 cluster size cluster_size=<size> - qcow2 cluster size
compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1]) compat=<str> - Compatibility level (v2 [0.10] or v3 [1.1])
compression_type=<str> - Compression method used for image cluster compression
data_file=<str> - File name of an external data file data_file=<str> - File name of an external data file
data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image data_file_raw=<bool (on/off)> - The external data file must stay valid as a raw image
encrypt.cipher-alg=<str> - Name of encryption cipher algorithm encrypt.cipher-alg=<str> - Name of encryption cipher algorithm

View File

@ -13,7 +13,7 @@ Formatting 'TEST_DIR/t.IMGFMT.2', fmt=IMGFMT size=134217728
=== Create a single snapshot on virtio0 === === Create a single snapshot on virtio0 ===
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/1-snapshot-v0.IMGFMT', 'format': 'IMGFMT' } } { '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 size=134217728 backing_file=TEST_DIR/t.qcow2.1 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2.1 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"return": {}}
=== Invalid command - missing device and nodename === === Invalid command - missing device and nodename ===
@ -30,40 +30,40 @@ Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file
=== Create several transactional group snapshots === === 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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/1-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/2-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/1-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2.2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/2-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/t.qcow2.2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/2-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/3-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/2-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/2-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/3-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/2-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/3-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/4-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/3-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/3-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/4-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/3-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/4-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/5-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/4-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/4-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/5-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/4-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/5-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/6-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/5-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/5-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/6-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/5-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/6-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/7-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/6-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/6-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/7-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/6-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/7-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/8-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/7-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/7-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/8-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/7-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/8-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/9-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/8-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/8-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/9-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/8-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"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' } } ] } } { '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 size=134217728 backing_file=TEST_DIR/9-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/10-snapshot-v0.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/9-snapshot-v0.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/9-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/10-snapshot-v1.qcow2', fmt=qcow2 size=134217728 backing_file=TEST_DIR/9-snapshot-v1.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"return": {}}
=== Create a couple of snapshots using blockdev-snapshot === === Create a couple of snapshots using blockdev-snapshot ===

View File

@ -9,7 +9,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=536870912
{ 'execute': 'qmp_capabilities' } { 'execute': 'qmp_capabilities' }
{"return": {}} {"return": {}}
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp.IMGFMT', 'format': 'IMGFMT' } } { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp.IMGFMT', 'format': 'IMGFMT' } }
Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"return": {}}
=== Performing block-commit on active layer === === Performing block-commit on active layer ===
@ -31,6 +31,6 @@ Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/
=== Performing Live Snapshot 2 === === Performing Live Snapshot 2 ===
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp2.IMGFMT', 'format': 'IMGFMT' } } { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'virtio0', 'snapshot-file':'TEST_DIR/tmp2.IMGFMT', 'format': 'IMGFMT' } }
Formatting 'TEST_DIR/tmp2.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/tmp2.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"return": {}}
*** done *** done

View File

@ -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' } } {'execute': 'blockdev-add', 'arguments': { 'node-name': 'node0', 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } }
{"return": {}} {"return": {}}
{'execute': 'blockdev-snapshot-sync', 'arguments': { 'node-name': 'node0', 'snapshot-file': 'TEST_DIR/t.IMGFMT.overlay', 'snapshot-node-name': 'node1' } } {'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 size=197120 backing_file=TEST_DIR/t.qcow2 backing_fmt=file cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_DIR/t.qcow2 backing_fmt=file cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"return": {}}
{'execute': 'blockdev-add', 'arguments': { 'node-name': 'node1', 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } } {'execute': 'blockdev-add', 'arguments': { 'node-name': 'node1', 'driver': 'file', 'filename': 'TEST_DIR/t.IMGFMT', 'locking': 'on' } }
{"return": {}} {"return": {}}

View File

@ -9,14 +9,14 @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
=== Creating backing chain === === Creating backing chain ===
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 'snapshot-file': 'TEST_DIR/t.IMGFMT.mid', 'format': 'IMGFMT', 'mode': 'absolute-paths' } } { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 'snapshot-file': 'TEST_DIR/t.IMGFMT.mid', 'format': 'IMGFMT', 'mode': 'absolute-paths' } }
Formatting 'TEST_DIR/t.qcow2.mid', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.base backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2.mid', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.base backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"return": {}}
{ 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu-io disk "write 0 4M"' } } { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu-io disk "write 0 4M"' } }
wrote 4194304/4194304 bytes at offset 0 wrote 4194304/4194304 bytes at offset 0
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
{"return": ""} {"return": ""}
{ 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 'snapshot-file': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'absolute-paths' } } { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'device': 'disk', 'snapshot-file': 'TEST_DIR/t.IMGFMT', 'format': 'IMGFMT', 'mode': 'absolute-paths' } }
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.mid backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.mid backing_fmt=qcow2 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"return": {}} {"return": {}}
=== Start commit job and exit qemu === === Start commit job and exit qemu ===
@ -48,7 +48,7 @@ Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.q
{ 'execute': 'qmp_capabilities' } { 'execute': 'qmp_capabilities' }
{"return": {}} {"return": {}}
{ 'execute': 'drive-mirror', 'arguments': { 'device': 'disk', 'target': 'TEST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 } } { 'execute': 'drive-mirror', 'arguments': { 'device': 'disk', 'target': 'TEST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 } }
Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}}
{"return": {}} {"return": {}}
@ -62,7 +62,7 @@ Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 l
{ 'execute': 'qmp_capabilities' } { 'execute': 'qmp_capabilities' }
{"return": {}} {"return": {}}
{ 'execute': 'drive-backup', 'arguments': { 'device': 'disk', 'target': 'TEST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 } } { 'execute': 'drive-backup', 'arguments': { 'device': 'disk', 'target': 'TEST_DIR/t.IMGFMT.copy', 'format': 'IMGFMT', 'sync': 'full', 'speed': 65536 } }
Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "disk"}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "disk"}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "paused", "id": "disk"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "paused", "id": "disk"}}

View File

@ -36,6 +36,7 @@ image: json:{ /* filtered */ }
file format: IMGFMT file format: IMGFMT
virtual size: 16 MiB (16777216 bytes) virtual size: 16 MiB (16777216 bytes)
Format specific information: Format specific information:
compression type: zlib
encrypt: encrypt:
ivgen alg: plain64 ivgen alg: plain64
hash alg: sha256 hash alg: sha256
@ -79,6 +80,7 @@ file format: IMGFMT
virtual size: 16 MiB (16777216 bytes) virtual size: 16 MiB (16777216 bytes)
backing file: TEST_DIR/t.IMGFMT.base backing file: TEST_DIR/t.IMGFMT.base
Format specific information: Format specific information:
compression type: zlib
encrypt: encrypt:
ivgen alg: plain64 ivgen alg: plain64
hash alg: sha256 hash alg: sha256

View File

@ -18,6 +18,7 @@ virtual size: 128 MiB (134217728 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -40,6 +41,7 @@ virtual size: 64 MiB (67108864 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -62,6 +64,7 @@ virtual size: 32 MiB (33554432 bytes)
cluster_size: 2097152 cluster_size: 2097152
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: true lazy refcounts: true
refcount bits: 1 refcount bits: 1
corrupt: false corrupt: false
@ -86,6 +89,7 @@ backing file: TEST_IMG.base
backing file format: IMGFMT backing file format: IMGFMT
Format specific information: Format specific information:
compat: 0.10 compat: 0.10
compression type: zlib
refcount bits: 16 refcount bits: 16
=== Successful image creation (encrypted) === === Successful image creation (encrypted) ===
@ -102,6 +106,7 @@ encrypted: yes
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
encrypt: encrypt:

View File

@ -12,6 +12,7 @@ virtual size: 1 MiB (1048576 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -32,6 +33,7 @@ virtual size: 1 MiB (1048576 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
bitmaps: bitmaps:
[0]: [0]:
@ -64,6 +66,7 @@ virtual size: 1 MiB (1048576 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
bitmaps: bitmaps:
[0]: [0]:
@ -104,6 +107,7 @@ virtual size: 1 MiB (1048576 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
bitmaps: bitmaps:
[0]: [0]:
@ -153,6 +157,7 @@ virtual size: 1 MiB (1048576 bytes)
cluster_size: 65536 cluster_size: 65536
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
bitmaps: bitmaps:
[0]: [0]:

View File

@ -3,9 +3,9 @@ Finishing a commit job with background reads
=== Create backing chain and start VM === === Create backing chain and start VM ===
Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-t.qcow2.mid', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
=== Start background read requests === === Start background read requests ===
@ -23,9 +23,9 @@ Closing the VM while a job is being cancelled
=== Create images and start VM === === Create images and start VM ===
Formatting 'TEST_DIR/PID-src.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-src.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-dst.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-dst.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 1048576/1048576 bytes at offset 0 wrote 1048576/1048576 bytes at offset 0
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

View File

@ -1,9 +1,9 @@
== Commit tests == == Commit tests ==
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 2097152/2097152 bytes at offset 0 wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -52,6 +52,7 @@ cluster_size: 65536
backing file: TEST_DIR/PID-base backing file: TEST_DIR/PID-base
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -63,11 +64,11 @@ read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing HMP commit (top -> mid) === === Testing HMP commit (top -> mid) ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 2097152/2097152 bytes at offset 0 wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -81,6 +82,7 @@ cluster_size: 65536
backing file: TEST_DIR/PID-base backing file: TEST_DIR/PID-base
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -92,11 +94,11 @@ read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing QMP active commit (top -> mid) === === Testing QMP active commit (top -> mid) ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=2097152 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-mid', fmt=qcow2 size=1048576 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=2097152 backing_file=TEST_DIR/PID-mid cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 2097152/2097152 bytes at offset 0 wrote 2097152/2097152 bytes at offset 0
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -116,6 +118,7 @@ cluster_size: 65536
backing file: TEST_DIR/PID-base backing file: TEST_DIR/PID-base
Format specific information: Format specific information:
compat: 1.1 compat: 1.1
compression type: zlib
lazy refcounts: false lazy refcounts: false
refcount bits: 16 refcount bits: 16
corrupt: false corrupt: false
@ -128,9 +131,9 @@ read 1048576/1048576 bytes at offset 1048576
== Resize tests == == Resize tests ==
=== preallocation=off === === preallocation=off ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=6442450944 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=6442450944 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=1073741824 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=1073741824 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 65536/65536 bytes at offset 5368709120 wrote 65536/65536 bytes at offset 5368709120
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -147,9 +150,9 @@ read 65536/65536 bytes at offset 5368709120
{ "start": 1073741824, "length": 7516192768, "depth": 0, "zero": true, "data": false}] { "start": 1073741824, "length": 7516192768, "depth": 0, "zero": true, "data": false}]
=== preallocation=metadata === === preallocation=metadata ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=34359738368 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=34359738368 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=32212254720 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=32212254720 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 65536/65536 bytes at offset 33285996544 wrote 65536/65536 bytes at offset 33285996544
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -171,9 +174,9 @@ read 65536/65536 bytes at offset 33285996544
{ "start": 34896609280, "length": 536870912, "depth": 0, "zero": true, "data": false, "offset": 2685075456}] { "start": 34896609280, "length": 536870912, "depth": 0, "zero": true, "data": false, "offset": 2685075456}]
=== preallocation=falloc === === preallocation=falloc ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=10485760 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=10485760 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=5242880 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=5242880 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 65536/65536 bytes at offset 9437184 wrote 65536/65536 bytes at offset 9437184
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -190,9 +193,9 @@ read 65536/65536 bytes at offset 9437184
{ "start": 5242880, "length": 10485760, "depth": 0, "zero": false, "data": true, "offset": 327680}] { "start": 5242880, "length": 10485760, "depth": 0, "zero": false, "data": true, "offset": 327680}]
=== preallocation=full === === preallocation=full ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=16777216 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=16777216 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=8388608 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=8388608 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 65536/65536 bytes at offset 11534336 wrote 65536/65536 bytes at offset 11534336
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -209,9 +212,9 @@ read 65536/65536 bytes at offset 11534336
{ "start": 8388608, "length": 4194304, "depth": 0, "zero": false, "data": true, "offset": 327680}] { "start": 8388608, "length": 4194304, "depth": 0, "zero": false, "data": true, "offset": 327680}]
=== preallocation=off === === preallocation=off ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=393216 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=393216 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=259072 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=259072 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 65536/65536 bytes at offset 259072 wrote 65536/65536 bytes at offset 259072
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -229,9 +232,9 @@ read 65536/65536 bytes at offset 259072
{ "start": 262144, "length": 262144, "depth": 0, "zero": true, "data": false}] { "start": 262144, "length": 262144, "depth": 0, "zero": true, "data": false}]
=== preallocation=off === === preallocation=off ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=409600 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=409600 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 65536/65536 bytes at offset 344064 wrote 65536/65536 bytes at offset 344064
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
@ -248,9 +251,9 @@ read 65536/65536 bytes at offset 344064
{ "start": 262144, "length": 262144, "depth": 0, "zero": true, "data": false}] { "start": 262144, "length": 262144, "depth": 0, "zero": true, "data": false}]
=== preallocation=off === === preallocation=off ===
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=524288 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=524288 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-top', fmt=qcow2 size=262144 backing_file=TEST_DIR/PID-base cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
wrote 65536/65536 bytes at offset 446464 wrote 65536/65536 bytes at offset 446464
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)

View File

@ -1,4 +1,4 @@
Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 Formatting 'TEST_DIR/PID-base', fmt=qcow2 size=67108864 cluster_size=65536 lazy_refcounts=off refcount_bits=16 compression_type=zlib
=== Launch VM === === Launch VM ===
Enabling migration QMP events on VM... Enabling migration QMP events on VM...

152
tests/qemu-iotests/287 Executable file
View File

@ -0,0 +1,152 @@
#!/usr/bin/env bash
#
# Test case for an image using zstd compression
#
# Copyright (c) 2020 Virtuozzo International GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# creator
owner=dplotnikov@virtuozzo.com
seq="$(basename $0)"
echo "QA output created by $seq"
status=1 # failure is the default!
# standard environment
. ./common.rc
. ./common.filter
# This tests qocw2-specific low-level functionality
_supported_fmt qcow2
_supported_proto file
_supported_os Linux
_unsupported_imgopts 'compat=0.10' data_file
COMPR_IMG="$TEST_IMG.compressed"
RAND_FILE="$TEST_DIR/rand_data"
_cleanup()
{
_cleanup_test_img
_rm_test_img "$COMPR_IMG"
rm -f "$RAND_FILE"
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# for all the cases
CLUSTER_SIZE=65536
# Check if we can run this test.
if IMGOPTS='compression_type=zstd' _make_test_img 64M |
grep "Invalid parameter 'zstd'"; then
_notrun "ZSTD is disabled"
fi
echo
echo "=== Testing compression type incompatible bit setting for zlib ==="
echo
_make_test_img -o compression_type=zlib 64M
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
echo
echo "=== Testing compression type incompatible bit setting for zstd ==="
echo
_make_test_img -o compression_type=zstd 64M
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
echo
echo "=== Testing zlib with incompatible bit set ==="
echo
_make_test_img -o compression_type=zlib 64M
$PYTHON qcow2.py "$TEST_IMG" set-feature-bit incompatible 3
# to make sure the bit was actually set
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then
echo "Error: The image opened successfully. The image must not be opened."
fi
echo
echo "=== Testing zstd with incompatible bit unset ==="
echo
_make_test_img -o compression_type=zstd 64M
$PYTHON qcow2.py "$TEST_IMG" set-header incompatible_features 0
# to make sure the bit was actually unset
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
if $QEMU_IMG info "$TEST_IMG" >/dev/null 2>&1 ; then
echo "Error: The image opened successfully. The image must not be opened."
fi
echo
echo "=== Testing compression type values ==="
echo
# zlib=0
_make_test_img -o compression_type=zlib 64M
peek_file_be "$TEST_IMG" 104 1
echo
# zstd=1
_make_test_img -o compression_type=zstd 64M
peek_file_be "$TEST_IMG" 104 1
echo
echo
echo "=== Testing simple reading and writing with zstd ==="
echo
_make_test_img -o compression_type=zstd 64M
$QEMU_IO -c "write -c -P 0xAC 64K 64K " "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "read -P 0xAC 64K 64K " "$TEST_IMG" | _filter_qemu_io
# read on the cluster boundaries
$QEMU_IO -c "read -v 131070 8 " "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "read -v 65534 8" "$TEST_IMG" | _filter_qemu_io
echo
echo "=== Testing adjacent clusters reading and writing with zstd ==="
echo
_make_test_img -o compression_type=zstd 64M
$QEMU_IO -c "write -c -P 0xAB 0 64K " "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "write -c -P 0xAC 64K 64K " "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "write -c -P 0xAD 128K 64K " "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "read -P 0xAB 0 64k " "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "read -P 0xAC 64K 64k " "$TEST_IMG" | _filter_qemu_io
$QEMU_IO -c "read -P 0xAD 128K 64k " "$TEST_IMG" | _filter_qemu_io
echo
echo "=== Testing incompressible cluster processing with zstd ==="
echo
# create a 2M image and fill it with 1M likely incompressible data
# and 1M compressible data
dd if=/dev/urandom of="$RAND_FILE" bs=1M count=1 seek=1
QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS_NO_FMT" \
$QEMU_IO -f raw -c "write -P 0xFA 0 1M" "$RAND_FILE" | _filter_qemu_io
$QEMU_IMG convert -f raw -O $IMGFMT -c \
-o "$(_optstr_add "$IMGOPTS" "compression_type=zlib")" "$RAND_FILE" \
"$TEST_IMG" | _filter_qemu_io
$QEMU_IMG convert -O $IMGFMT -c \
-o "$(_optstr_add "$IMGOPTS" "compression_type=zstd")" "$TEST_IMG" \
"$COMPR_IMG" | _filter_qemu_io
$QEMU_IMG compare "$TEST_IMG" "$COMPR_IMG"
# success, all done
echo "*** done"
rm -f $seq.full
status=0

View File

@ -0,0 +1,67 @@
QA output created by 287
=== Testing compression type incompatible bit setting for zlib ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
incompatible_features []
=== Testing compression type incompatible bit setting for zstd ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
incompatible_features [3]
=== Testing zlib with incompatible bit set ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
incompatible_features [3]
=== Testing zstd with incompatible bit unset ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
incompatible_features []
=== Testing compression type values ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
1
=== Testing simple reading and writing with zstd ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 65536/65536 bytes at offset 65536
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 65536/65536 bytes at offset 65536
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0001fffe: ac ac 00 00 00 00 00 00 ........
read 8/8 bytes at offset 131070
8 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
0000fffe: 00 00 ac ac ac ac ac ac ........
read 8/8 bytes at offset 65534
8 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing adjacent clusters reading and writing with zstd ===
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 65536/65536 bytes at offset 0
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 65536/65536 bytes at offset 65536
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 65536/65536 bytes at offset 131072
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 65536/65536 bytes at offset 0
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 65536/65536 bytes at offset 65536
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 65536/65536 bytes at offset 131072
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Testing incompressible cluster processing with zstd ===
1+0 records in
1+0 records out
wrote 1048576/1048576 bytes at offset 0
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Images are identical.
*** done

View File

@ -152,7 +152,8 @@ _filter_img_create()
-e "s# refcount_bits=[0-9]\\+##g" \ -e "s# refcount_bits=[0-9]\\+##g" \
-e "s# key-secret=[a-zA-Z0-9]\\+##g" \ -e "s# key-secret=[a-zA-Z0-9]\\+##g" \
-e "s# iter-time=[0-9]\\+##g" \ -e "s# iter-time=[0-9]\\+##g" \
-e "s# force_size=\\(on\\|off\\)##g" -e "s# force_size=\\(on\\|off\\)##g" \
-e "s# compression_type=[a-zA-Z0-9]\\+##g"
} }
_filter_img_info() _filter_img_info()

View File

@ -295,6 +295,7 @@
283 auto quick 283 auto quick
284 rw 284 rw
286 rw quick 286 rw quick
287 auto quick
288 quick 288 quick
289 rw quick 289 rw quick
290 rw auto quick 290 rw auto quick