qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 26/27] qemu-iotests: Test qcow2 over file image


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 26/27] qemu-iotests: Test qcow2 over file image creation with QMP
Date: Mon, 12 Feb 2018 18:50:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 2018-02-08 20:23, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  tests/qemu-iotests/206     | 436 
> +++++++++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/206.out | 209 ++++++++++++++++++++++
>  tests/qemu-iotests/group   |   1 +
>  3 files changed, 646 insertions(+)
>  create mode 100755 tests/qemu-iotests/206
>  create mode 100644 tests/qemu-iotests/206.out

Reviewed-by: Max Reitz <address@hidden>

> diff --git a/tests/qemu-iotests/206 b/tests/qemu-iotests/206
> new file mode 100755
> index 0000000000..0a18b2b19a
> --- /dev/null
> +++ b/tests/qemu-iotests/206
> @@ -0,0 +1,436 @@

[...]

> +# creator
> address@hidden
> +
> +seq=`basename $0`
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +status=1     # failure is the default!

Hmmm...  Didn't we want to remove this boilerplate at some point?

> +
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./common.filter
> +
> +_supported_fmt qcow2
> +_supported_proto file
> +_supported_os Linux
> +

[...]

> +echo
> +echo "=== Invalid sizes ==="
> +echo
> +
> +# TODO Negative image sizes aren't handled correctly, but this is a problem
> +# with QAPI's implementation of the 'size' type and affects other commands as
> +# well. Once this is fixed, we may want to add a test case here.
> +
> +# 1. Misaligned image size
> +# 2. 2^64 - 512
> +# 3. 2^63 = 8 EB (qemu-img enforces image sizes less than this)
> +# 4. 2^63 - 512 (generally valid, but qcow2 can't handle images this size)
> +
> +run_qemu -blockdev driver=file,filename="$TEST_IMG",node-name=node0 <<EOF
> +{ "execute": "qmp_capabilities" }
> +{ "execute": "x-blockdev-create",
> +  "arguments": {
> +      "driver": "$IMGFMT",
> +      "file": "node0",
> +      "size": 1234
> +  }
> +}
> +{ "execute": "x-blockdev-create",
> +  "arguments": {
> +      "driver": "$IMGFMT",
> +      "file": "node0",
> +      "size": 18446744073709551104

I was about to propose $((2**64 - 512)), but then I noticed that yields
-512.  Nice.

> +  }
> +}
> +{ "execute": "x-blockdev-create",
> +  "arguments": {
> +      "driver": "$IMGFMT",
> +      "file": "node0",
> +      "size": 9223372036854775808
> +  }
> +}
> +{ "execute": "x-blockdev-create",
> +  "arguments": {
> +      "driver": "$IMGFMT",
> +      "file": "node0",
> +      "size": 9223372036854775296
> +  }
> +}
> +{ "execute": "quit" }
> +EOF

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]