convert [-C] [-c] [-p] [-n] [-f fmt] [-t cache] [-T src_cache] [-O output_fmt] [-B backing_file] [-o options] [-s snapshot_id_or_name] [-l snapshot_param] [-m num_coroutines] [-W] [-S sparse_size] filename [filename2
[...]] output_filename
Convert the disk image filename or a snapshot snapshot_param(snapshot_id_or_name is deprecated) to disk image output_filename using format output_fmt. It can be optionally compressed ("-c" option) or use any format
specific options like encryption ("-o" option).
Only the formats "qcow" and "qcow2" support compression. The compression is read-only. It means that if a compressed sector is rewritten, then it is rewritten as uncompressed data.
Image conversion is also useful to get smaller image when using a growable format such as "qcow": the empty sectors are detected and suppressed from the destination image.
sparse_size indicates the consecutive number of bytes (defaults to 4k) that must contain only zeros for qemu-img to create a sparse image during conversion. If sparse_size is 0, the source will not be scanned for
unallocated or zero sectors, and the destination image will always be fully allocated.
You can use the backing_file option to force the output image to be created as a copy on write image of the specified base image; the backing_file should have the same content as the input's base image, however the
path, image format, etc may differ.
If a relative path name is given, the backing file is looked up relative to the directory containing output_filename.
If the "-n" option is specified, the target volume creation will be skipped. This is useful for formats such as "rbd" if the target volume has already been created with site specific options that cannot be supplied
through qemu-img.
Out of order writes can be enabled with "-W" to improve performance. This is only recommended for preallocated devices like host devices or other raw block devices. Out of order write does not work in combination
with creating compressed images.
num_coroutines specifies how many coroutines work in parallel during the convert process (defaults to 8).