2013-01-29 17:46:52 +08:00
|
|
|
QA output created by 049
|
|
|
|
=== Check correct interpretation of suffixes for image size ===
|
|
|
|
|
|
|
|
== 1. Traditional size parameter ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024b
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1k
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1K
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1G
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1T
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1024.0b
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5k
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5K
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5G
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 1.5T
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
== 2. Specifying size via -o ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1024 TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1024b TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1k TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1K TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1M TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1048576 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1G TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1073741824 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1T TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1099511627776 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1024.0 TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1024.0b TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1024 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1.5k TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1.5K TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1536 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1.5M TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1572864 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1.5G TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1610612736 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1.5T TEST_DIR/t.qcow2
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=1649267441664 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
== 3. Invalid sizes ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1024
|
|
|
|
qemu-img: Image size must be less than 8 EiB!
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=-1024 TEST_DIR/t.qcow2
|
2018-10-17 16:27:00 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Value '-1024' is out of range for parameter 'size'
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1k
|
|
|
|
qemu-img: Image size must be less than 8 EiB!
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=-1k TEST_DIR/t.qcow2
|
2018-10-17 16:27:00 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Value '-1k' is out of range for parameter 'size'
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1kilobyte
|
2014-12-09 15:38:03 +08:00
|
|
|
qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes for
|
2013-06-05 20:19:27 +08:00
|
|
|
qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=1kilobyte TEST_DIR/t.qcow2
|
2018-10-17 16:27:00 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Parameter 'size' expects a non-negative number below 2^64
|
2017-02-27 20:55:43 +08:00
|
|
|
Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
|
|
|
|
and exabytes, respectively.
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- foobar
|
2014-12-09 15:38:03 +08:00
|
|
|
qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes for
|
2013-06-05 20:19:27 +08:00
|
|
|
qemu-img: kilobytes, megabytes, gigabytes, terabytes, petabytes and exabytes.
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o size=foobar TEST_DIR/t.qcow2
|
2018-10-17 16:27:00 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Parameter 'size' expects a non-negative number below 2^64
|
2017-02-27 20:55:43 +08:00
|
|
|
Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
|
|
|
|
and exabytes, respectively.
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
== Check correct interpretation of suffixes for cluster size ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=1024 TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=1024b TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=1k TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=1K TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=1M TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1048576 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=1024.0 TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=1024.0b TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=1024 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=0.5k TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=0.5K TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=512 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o cluster_size=0.5M TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=524288 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
== Check compat level option ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=0.10 TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=1.1 TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=0.42 TEST_DIR/t.qcow2 64M
|
2018-01-11 23:18:08 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Invalid parameter '0.42'
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.42 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=foobar TEST_DIR/t.qcow2 64M
|
2018-01-11 23:18:08 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Invalid parameter 'foobar'
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=foobar cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
== Check preallocation option ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o preallocation=off TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=off lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o preallocation=metadata TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=metadata lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o preallocation=1234 TEST_DIR/t.qcow2 64M
|
2018-01-11 23:18:08 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Invalid parameter '1234'
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 cluster_size=65536 preallocation=1234 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
== Check encryption option ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o encryption=off TEST_DIR/t.qcow2 64M
|
2015-02-19 06:40:49 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
2017-06-24 00:24:10 +08:00
|
|
|
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
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
== Check lazy_refcounts option (only with v3) ==
|
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=off TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=1.1,lazy_refcounts=on TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=1.1 cluster_size=65536 lazy_refcounts=on refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=off TEST_DIR/t.qcow2 64M
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=off refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
qemu-img create -f qcow2 -o compat=0.10,lazy_refcounts=on TEST_DIR/t.qcow2 64M
|
2018-01-11 23:18:08 +08:00
|
|
|
qemu-img: TEST_DIR/t.qcow2: Lazy refcounts only supported with compatibility level 1.1 and above (use version=v3 or greater)
|
2017-06-24 00:24:06 +08:00
|
|
|
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 compat=0.10 cluster_size=65536 lazy_refcounts=on refcount_bits=16
|
2013-01-29 17:46:52 +08:00
|
|
|
|
|
|
|
*** done
|