From 638987127db0e3b0c23e86cb9dcc19f988d84be4 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Fri, 19 Oct 2018 18:49:25 +0200 Subject: [PATCH] option: Make option help nicer to read MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This adds some whitespace into the option help (including indentation) and puts angle brackets around the type names. Furthermore, the list name is no longer printed as part of every line, but only once in advance, and only if the caller did not print a caption already. This patch also restores the description alignment we had before commit 9cbef9d68ee1d8d0, just at 24 instead of 16 characters like we used to. This increase is because now we have the type and two spaces of indentation before the description, and with a usual type name length of three chracters, this sums up to eight additional characters -- which means that we now need 24 characters to get the same amount of padding for most options. Also, 24 is a third of 80, which makes it kind of a round number in terminal terms. Finally, this patch amends the reference output of iotest 082 to match the changes (and thus makes it pass again). Signed-off-by: Max Reitz Reviewed-by: Marc-André Lureau Signed-off-by: Kevin Wolf --- include/qemu/option.h | 2 +- qemu-img.c | 4 +- tests/qemu-iotests/082.out | 1572 ++++++++++++++++++++++---------------------- util/qemu-option.c | 32 +- 4 files changed, 815 insertions(+), 795 deletions(-) rewrite tests/qemu-iotests/082.out (72%) diff --git a/include/qemu/option.h b/include/qemu/option.h index 3dfb4493cc..844587cab3 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -132,7 +132,7 @@ typedef int (*qemu_opts_loopfunc)(void *opaque, QemuOpts *opts, Error **errp); int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func, void *opaque, Error **errp); void qemu_opts_print(QemuOpts *opts, const char *sep); -void qemu_opts_print_help(QemuOptsList *list); +void qemu_opts_print_help(QemuOptsList *list, bool print_caption); void qemu_opts_free(QemuOptsList *list); QemuOptsList *qemu_opts_append(QemuOptsList *dst, QemuOptsList *list); diff --git a/qemu-img.c b/qemu-img.c index b12f4cd19b..4c96db7ba4 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -269,7 +269,7 @@ static int print_block_option_help(const char *filename, const char *fmt) } printf("Supported options:\n"); - qemu_opts_print_help(create_opts); + qemu_opts_print_help(create_opts, false); qemu_opts_free(create_opts); return 0; } @@ -3773,7 +3773,7 @@ static int print_amend_option_help(const char *format) assert(drv->create_opts); printf("Creation options for '%s':\n", format); - qemu_opts_print_help(drv->create_opts); + qemu_opts_print_help(drv->create_opts, false); printf("\nNote that not all of these options may be amendable.\n"); return 0; } diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out dissimilarity index 72% index 19e9fb13ff..0ce18c075b 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -1,786 +1,786 @@ -QA output created by 082 - -=== create: Options specified more than once === - -Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 65536 - -Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=4096 lazy_refcounts=on refcount_bits=16 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 4096 -Format specific information: - compat: 1.1 - lazy refcounts: true - refcount bits: 16 - corrupt: false - -Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=on refcount_bits=16 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 8192 -Format specific information: - compat: 1.1 - lazy refcounts: true - refcount bits: 16 - corrupt: false - -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 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 8192 - -=== create: help for -o === - -Testing: create -f qcow2 -o help TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: create -f qcow2 -o ? TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: create -f qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: create -f qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: create -f qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: create -f qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: create -f qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: create -f qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 128M -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -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 - -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 - -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, - -Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,help TEST_DIR/t.qcow2 128M -qemu-img: Invalid option list: ,help - -Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR/t.qcow2 128M -qemu-img: Invalid option list: ,, - -Testing: create -f qcow2 -o help -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Testing: create -o help -Supported options: -size Virtual disk size - -Testing: create -f bochs -o help -qemu-img: Format driver 'bochs' does not support image creation - -=== convert: Options specified more than once === - -Testing: create -f qcow2 TEST_DIR/t.qcow2 128M -Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 - -Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -image: TEST_DIR/t.IMGFMT.base -file format: raw -virtual size: 128M (134217728 bytes) - -Testing: convert -O foo -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -image: TEST_DIR/t.IMGFMT.base -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 65536 - -Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -image: TEST_DIR/t.IMGFMT.base -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 4096 -Format specific information: - compat: 1.1 - lazy refcounts: true - refcount bits: 16 - corrupt: false - -Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -image: TEST_DIR/t.IMGFMT.base -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 8192 -Format specific information: - compat: 1.1 - lazy refcounts: true - refcount bits: 16 - corrupt: false - -Testing: convert -O qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -image: TEST_DIR/t.IMGFMT.base -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 8192 - -=== convert: help for -o === - -Testing: convert -O qcow2 -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o ? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits -nocow Turn off copy-on-write (valid only on btrfs) - -Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,help': No such file or directory - -Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,?': No such file or directory - -Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2, - -Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -qemu-img: Invalid option list: ,help - -Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base -qemu-img: Invalid option list: ,, - -Testing: convert -O qcow2 -o help -Supported options: -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Testing: convert -o help -Supported options: -size Virtual disk size - -Testing: convert -O bochs -o help -qemu-img: Format driver 'bochs' does not support image creation - -=== convert: -C and other options === - -Testing: convert -C -S 4k -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target -qemu-img: Cannot enable copy offloading when -S is used - -Testing: convert -C -S 8k -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target -qemu-img: Cannot enable copy offloading when -S is used - -Testing: convert -C -c -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target -qemu-img: Cannot enable copy offloading when -c is used - -=== amend: Options specified more than once === - -Testing: amend -f foo -f qcow2 -o lazy_refcounts=on TEST_DIR/t.qcow2 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 128M (134217728 bytes) -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: true - refcount bits: 16 - corrupt: false - -Testing: amend -f qcow2 -o size=130M -o lazy_refcounts=off TEST_DIR/t.qcow2 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 130M (136314880 bytes) -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: false - refcount bits: 16 - corrupt: false - -Testing: amend -f qcow2 -o size=8M -o lazy_refcounts=on -o size=132M TEST_DIR/t.qcow2 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 132M (138412032 bytes) -cluster_size: 65536 -Format specific information: - compat: 1.1 - lazy refcounts: true - refcount bits: 16 - corrupt: false - -Testing: amend -f qcow2 -o size=4M,size=148M TEST_DIR/t.qcow2 -image: TEST_DIR/t.IMGFMT -file format: IMGFMT -virtual size: 148M (155189248 bytes) -cluster_size: 65536 - -=== amend: help for -o === - -Testing: amend -f qcow2 -o help TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o ? TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 - -Testing: rebase -u -b -f qcow2 TEST_DIR/t.qcow2 - -Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 - -Testing: rebase -u -b -f qcow2 TEST_DIR/t.qcow2 - -Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 -qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2, - -Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,help TEST_DIR/t.qcow2 -qemu-img: Invalid option list: ,help - -Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR/t.qcow2 -qemu-img: Invalid option list: ,, - -Testing: amend -f qcow2 -o help -Creation options for 'qcow2': -size Virtual disk size -compat Compatibility level (0.10 or 1.1) -backing_file File name of a base image -backing_fmt Image format of the base image -encryption Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) -encrypt.format Encrypt the image, format choices: 'aes', 'luks' -encrypt.key-secret ID of secret providing qcow AES key or LUKS passphrase -encrypt.cipher-alg Name of encryption cipher algorithm -encrypt.cipher-mode Name of encryption cipher mode -encrypt.ivgen-alg Name of IV generator algorithm -encrypt.ivgen-hash-alg Name of IV generator hash algorithm -encrypt.hash-alg Name of encryption hash algorithm -encrypt.iter-time Time to spend in PBKDF in milliseconds -cluster_size qcow2 cluster size -preallocation Preallocation mode (allowed values: off, metadata, falloc, full) -lazy_refcounts Postpone refcount updates -refcount_bits Width of a reference count entry in bits - -Note that not all of these options may be amendable. - -Testing: convert -o help -Supported options: -size Virtual disk size - -Testing: amend -f bochs -o help -qemu-img: Format driver 'bochs' does not support option amendment -*** done +QA output created by 082 + +=== create: Options specified more than once === + +Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M +Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 65536 + +Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 128M +Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=4096 lazy_refcounts=on refcount_bits=16 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 4096 +Format specific information: + compat: 1.1 + lazy refcounts: true + refcount bits: 16 + corrupt: false + +Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 128M +Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=on refcount_bits=16 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 8192 +Format specific information: + compat: 1.1 + lazy refcounts: true + refcount bits: 16 + corrupt: false + +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 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 8192 + +=== create: help for -o === + +Testing: create -f qcow2 -o help TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -f qcow2 -o ? TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -f qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -f qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -f qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -f qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -f qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -f qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 128M +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +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 + +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 + +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, + +Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,help TEST_DIR/t.qcow2 128M +qemu-img: Invalid option list: ,help + +Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR/t.qcow2 128M +qemu-img: Invalid option list: ,, + +Testing: create -f qcow2 -o help +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: create -o help +Supported options: + size= - Virtual disk size + +Testing: create -f bochs -o help +qemu-img: Format driver 'bochs' does not support image creation + +=== convert: Options specified more than once === + +Testing: create -f qcow2 TEST_DIR/t.qcow2 128M +Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 + +Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +image: TEST_DIR/t.IMGFMT.base +file format: raw +virtual size: 128M (134217728 bytes) + +Testing: convert -O foo -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +image: TEST_DIR/t.IMGFMT.base +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 65536 + +Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +image: TEST_DIR/t.IMGFMT.base +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 4096 +Format specific information: + compat: 1.1 + lazy refcounts: true + refcount bits: 16 + corrupt: false + +Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +image: TEST_DIR/t.IMGFMT.base +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 8192 +Format specific information: + compat: 1.1 + lazy refcounts: true + refcount bits: 16 + corrupt: false + +Testing: convert -O qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +image: TEST_DIR/t.IMGFMT.base +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 8192 + +=== convert: help for -o === + +Testing: convert -O qcow2 -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o ? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + nocow= - Turn off copy-on-write (valid only on btrfs) + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,help': No such file or directory + +Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +qemu-img: Could not open 'TEST_DIR/t.qcow2.base': Could not open backing file: Could not open 'TEST_DIR/t.qcow2,?': No such file or directory + +Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2, + +Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +qemu-img: Invalid option list: ,help + +Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base +qemu-img: Invalid option list: ,, + +Testing: convert -O qcow2 -o help +Supported options: + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Testing: convert -o help +Supported options: + size= - Virtual disk size + +Testing: convert -O bochs -o help +qemu-img: Format driver 'bochs' does not support image creation + +=== convert: -C and other options === + +Testing: convert -C -S 4k -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target +qemu-img: Cannot enable copy offloading when -S is used + +Testing: convert -C -S 8k -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target +qemu-img: Cannot enable copy offloading when -S is used + +Testing: convert -C -c -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.target +qemu-img: Cannot enable copy offloading when -c is used + +=== amend: Options specified more than once === + +Testing: amend -f foo -f qcow2 -o lazy_refcounts=on TEST_DIR/t.qcow2 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 128M (134217728 bytes) +cluster_size: 65536 +Format specific information: + compat: 1.1 + lazy refcounts: true + refcount bits: 16 + corrupt: false + +Testing: amend -f qcow2 -o size=130M -o lazy_refcounts=off TEST_DIR/t.qcow2 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 130M (136314880 bytes) +cluster_size: 65536 +Format specific information: + compat: 1.1 + lazy refcounts: false + refcount bits: 16 + corrupt: false + +Testing: amend -f qcow2 -o size=8M -o lazy_refcounts=on -o size=132M TEST_DIR/t.qcow2 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 132M (138412032 bytes) +cluster_size: 65536 +Format specific information: + compat: 1.1 + lazy refcounts: true + refcount bits: 16 + corrupt: false + +Testing: amend -f qcow2 -o size=4M,size=148M TEST_DIR/t.qcow2 +image: TEST_DIR/t.IMGFMT +file format: IMGFMT +virtual size: 148M (155189248 bytes) +cluster_size: 65536 + +=== amend: help for -o === + +Testing: amend -f qcow2 -o help TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o ? TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o cluster_size=4k,help TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o cluster_size=4k,? TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o help,cluster_size=4k TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o ?,cluster_size=4k TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o cluster_size=4k -o help TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o cluster_size=4k -o ? TEST_DIR/t.qcow2 +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,help TEST_DIR/t.qcow2 + +Testing: rebase -u -b -f qcow2 TEST_DIR/t.qcow2 + +Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2,,? TEST_DIR/t.qcow2 + +Testing: rebase -u -b -f qcow2 TEST_DIR/t.qcow2 + +Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2, -o help TEST_DIR/t.qcow2 +qemu-img: Invalid option list: backing_file=TEST_DIR/t.qcow2, + +Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,help TEST_DIR/t.qcow2 +qemu-img: Invalid option list: ,help + +Testing: amend -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR/t.qcow2 +qemu-img: Invalid option list: ,, + +Testing: amend -f qcow2 -o help +Creation options for 'qcow2': + backing_file= - File name of a base image + backing_fmt= - Image format of the base image + cluster_size= - qcow2 cluster size + compat= - Compatibility level (0.10 or 1.1) + encrypt.cipher-alg= - Name of encryption cipher algorithm + encrypt.cipher-mode= - Name of encryption cipher mode + encrypt.format= - Encrypt the image, format choices: 'aes', 'luks' + encrypt.hash-alg= - Name of encryption hash algorithm + encrypt.iter-time= - Time to spend in PBKDF in milliseconds + encrypt.ivgen-alg= - Name of IV generator algorithm + encrypt.ivgen-hash-alg= - Name of IV generator hash algorithm + encrypt.key-secret= - ID of secret providing qcow AES key or LUKS passphrase + encryption= - Encrypt the image with format 'aes'. (Deprecated in favor of encrypt.format=aes) + lazy_refcounts= - Postpone refcount updates + preallocation= - Preallocation mode (allowed values: off, metadata, falloc, full) + refcount_bits= - Width of a reference count entry in bits + size= - Virtual disk size + +Note that not all of these options may be amendable. + +Testing: convert -o help +Supported options: + size= - Virtual disk size + +Testing: amend -f bochs -o help +qemu-img: Format driver 'bochs' does not support option amendment +*** done diff --git a/util/qemu-option.c b/util/qemu-option.c index 9a5f263294..de42e2a406 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -224,7 +224,14 @@ static const char *opt_type_to_string(enum QemuOptType type) g_assert_not_reached(); } -void qemu_opts_print_help(QemuOptsList *list) +/** + * Print the list of options available in the given list. If + * @print_caption is true, a caption (including the list name, if it + * exists) is printed. The options itself will be indented, so + * @print_caption should only be set to false if the caller prints its + * own custom caption (so that the indentation makes sense). + */ +void qemu_opts_print_help(QemuOptsList *list, bool print_caption) { QemuOptDesc *desc; int i; @@ -234,12 +241,12 @@ void qemu_opts_print_help(QemuOptsList *list) desc = list->desc; while (desc && desc->name) { GString *str = g_string_new(NULL); - if (list->name) { - g_string_append_printf(str, "%s.", list->name); - } - g_string_append_printf(str, "%s=%s", desc->name, + g_string_append_printf(str, " %s=<%s>", desc->name, opt_type_to_string(desc->type)); if (desc->help) { + if (str->len < 24) { + g_string_append_printf(str, "%*s", 24 - (int)str->len, ""); + } g_string_append_printf(str, " - %s", desc->help); } g_ptr_array_add(array, g_string_free(str, false)); @@ -247,6 +254,19 @@ void qemu_opts_print_help(QemuOptsList *list) } g_ptr_array_sort(array, (GCompareFunc)qemu_pstrcmp0); + if (print_caption && array->len > 0) { + if (list->name) { + printf("%s options:\n", list->name); + } else { + printf("Options:\n"); + } + } else if (array->len == 0) { + if (list->name) { + printf("There are no options for %s.\n", list->name); + } else { + printf("No options available.\n"); + } + } for (i = 0; i < array->len; i++) { printf("%s\n", (char *)array->pdata[i]); } @@ -930,7 +950,7 @@ QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params, opts = opts_parse(list, params, permit_abbrev, false, &invalidp, &err); if (err) { if (invalidp && has_help_option(params)) { - qemu_opts_print_help(list); + qemu_opts_print_help(list, true); error_free(err); } else { error_report_err(err); -- 2.11.4.GIT