From nobody Wed Nov 5 15:40:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497361569429809.8228234641568; Tue, 13 Jun 2017 06:46:09 -0700 (PDT) Received: from localhost ([::1]:43373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKm92-0003Lc-1d for importer@patchew.org; Tue, 13 Jun 2017 09:46:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKlxr-0001vL-Hv for qemu-devel@nongnu.org; Tue, 13 Jun 2017 09:34:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKlxk-0000nV-HQ for qemu-devel@nongnu.org; Tue, 13 Jun 2017 09:34:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43280) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dKlxk-0000mw-89 for qemu-devel@nongnu.org; Tue, 13 Jun 2017 09:34:28 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DE61A08E4; Tue, 13 Jun 2017 13:34:27 +0000 (UTC) Received: from localhost (ovpn-117-200.ams2.redhat.com [10.36.117.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C2F385930; Tue, 13 Jun 2017 13:34:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4DE61A08E4 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=stefanha@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4DE61A08E4 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Date: Tue, 13 Jun 2017 14:33:29 +0100 Message-Id: <20170613133329.23653-10-stefanha@redhat.com> In-Reply-To: <20170613133329.23653-1-stefanha@redhat.com> References: <20170613133329.23653-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 13 Jun 2017 13:34:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v7 9/9] iotests: add test 178 for qemu-img measure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , John Snow , Nir Soffer , Maor Lipchuk , Stefan Hajnoczi , Alberto Garcia Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia --- v7: * Check max file size with 7 exabytes [Berto] --- tests/qemu-iotests/178 | 169 +++++++++++++++++++++++ tests/qemu-iotests/178.out.qcow2 | 280 +++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/178.out.raw | 152 +++++++++++++++++++++ tests/qemu-iotests/group | 1 + 4 files changed, 602 insertions(+) create mode 100755 tests/qemu-iotests/178 create mode 100644 tests/qemu-iotests/178.out.qcow2 create mode 100644 tests/qemu-iotests/178.out.raw diff --git a/tests/qemu-iotests/178 b/tests/qemu-iotests/178 new file mode 100755 index 0000000..79380a0 --- /dev/null +++ b/tests/qemu-iotests/178 @@ -0,0 +1,169 @@ +#!/bin/bash +# +# qemu-img measure sub-command tests +# +# Copyright (C) 2017 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# creator +owner=3Dstefanha@redhat.com + +seq=3D`basename $0` +echo "QA output created by $seq" + +here=3D`pwd` +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img + rm -f "$TEST_IMG.converted" +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.pattern + +_supported_fmt raw qcow2 +_supported_proto file +_supported_os Linux + +echo "=3D=3D Input validation =3D=3D" +echo + +_make_test_img 1G + +$QEMU_IMG measure # missing arguments +$QEMU_IMG measure --size 2G "$TEST_IMG" # only one allowed +$QEMU_IMG measure "$TEST_IMG" a # only one filename allowed +$QEMU_IMG measure --object secret,id=3Dsec0,data=3DMTIzNDU2,format=3Dbase6= 4 # missing filename +$QEMU_IMG measure --image-opts # missing filename +$QEMU_IMG measure -f qcow2 # missing filename +$QEMU_IMG measure -l snap1 # missing filename +$QEMU_IMG measure -o , # invalid option list +$QEMU_IMG measure -l snapshot.foo # invalid snapshot option +$QEMU_IMG measure --output foo # invalid output format +$QEMU_IMG measure --size -1 # invalid image size +$QEMU_IMG measure -O foo "$TEST_IMG" # unknown image file format + +make_test_img_with_fmt() { + # Shadow global variables within this function + local IMGFMT=3D"$1" IMGOPTS=3D"" + _make_test_img "$2" +} + +qemu_io_with_fmt() { + # Shadow global variables within this function + local QEMU_IO_OPTIONS=3D$(echo "$QEMU_IO_OPTIONS" | sed "s/-f $IMGFMT/= -f $1/") + shift + $QEMU_IO "$@" +} + +# The proof is in the pudding: converted image size cannot be larger than = the +# required size. +# +# Note: if a change to the image format code causes the file size to chang= e, +# then this test fails! This is good because it's a reminder to check tha= t the +# required size is still at least as big as the actual converted file size. +convert_and_show_size() { + local fmt=3D"$1" + shift + $QEMU_IMG convert -f "$fmt" -O "$IMGFMT" "$TEST_IMG" "$@" "$TEST_IMG.c= onverted" + stat -c "converted image file size in bytes: %s" "$TEST_IMG.converted" +} + +for ofmt in human json; do + echo + echo "=3D=3D Size calculation for a new file ($ofmt) =3D=3D" + echo + + # Try a few interesting sizes + $QEMU_IMG measure --output=3D$ofmt -O "$IMGFMT" --size 0 + $QEMU_IMG measure --output=3D$ofmt -O "$IMGFMT" --size 2G + $QEMU_IMG measure --output=3D$ofmt -O "$IMGFMT" --size 64G + $QEMU_IMG measure --output=3D$ofmt -O "$IMGFMT" --size 256G + $QEMU_IMG measure --output=3D$ofmt -O "$IMGFMT" --size 1T + $QEMU_IMG measure --output=3D$ofmt -O "$IMGFMT" --size 7E + + # Always test the raw input files but also IMGFMT + for fmt in $(echo -e "raw\n$IMGFMT\n" | sort -u); do + echo + echo "=3D=3D Empty $fmt input image ($ofmt) =3D=3D" + echo + make_test_img_with_fmt "$fmt" 0 + $QEMU_IMG measure --output=3D$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_I= MG" + echo + convert_and_show_size "$fmt" + + echo + echo "=3D=3D $fmt input image with data ($ofmt) =3D=3D" + echo + make_test_img_with_fmt "$fmt" 1G + $QEMU_IMG measure --output=3D$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_I= MG" + qemu_io_with_fmt "$fmt" -c "write 512 512" "$TEST_IMG" | _filter_q= emu_io + qemu_io_with_fmt "$fmt" -c "write 64K 64K" "$TEST_IMG" | _filter_q= emu_io + if [ "$fmt" =3D "qcow2" ]; then + $QEMU_IMG snapshot -c snapshot1 "$TEST_IMG" + fi + qemu_io_with_fmt "$fmt" -c "write 128M 63K" "$TEST_IMG" | _filter_= qemu_io + $QEMU_IMG measure --output=3D$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_I= MG" + echo + convert_and_show_size "$fmt" + + if [ "$fmt" =3D "qcow2" ]; then + echo + echo "=3D=3D $fmt input image with internal snapshot ($ofmt) = =3D=3D" + echo + $QEMU_IMG measure --output=3D$ofmt -f "$fmt" -l snapshot1 \ + -O "$IMGFMT" "$TEST_IMG" + echo + convert_and_show_size "$fmt" -l snapshot1 + fi + + if [ "$IMGFMT" =3D "qcow2" ]; then + echo + echo "=3D=3D $fmt input image and a backing file ($ofmt) =3D= =3D" + echo + # The backing file doesn't need to exist :) + $QEMU_IMG measure --output=3D$ofmt -o backing_file=3Dx \ + -f "$fmt" -O "$IMGFMT" "$TEST_IMG" + fi + + echo + echo "=3D=3D $fmt input image and preallocation ($ofmt) =3D=3D" + echo + $QEMU_IMG measure --output=3D$ofmt -o preallocation=3Dfull \ + -f "$fmt" -O "$IMGFMT" "$TEST_IMG" + echo + convert_and_show_size "$fmt" -o preallocation=3Dfull + + echo + echo "=3D=3D Fully-allocated $fmt input image ($ofmt) =3D=3D" + echo + make_test_img_with_fmt "$fmt" 8M + qemu_io_with_fmt "$fmt" -c "write 0 8M" "$TEST_IMG" | _filter_qemu= _io + $QEMU_IMG measure --output=3D$ofmt -f "$fmt" -O "$IMGFMT" "$TEST_I= MG" + echo + convert_and_show_size "$fmt" + done +done + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/178.out.qcow2 b/tests/qemu-iotests/178.out.= qcow2 new file mode 100644 index 0000000..5311374 --- /dev/null +++ b/tests/qemu-iotests/178.out.qcow2 @@ -0,0 +1,280 @@ +QA output created by 178 +=3D=3D Input validation =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 +qemu-img: Either --size N or one filename must be specified. +qemu-img: --size N cannot be used together with a filename. +qemu-img: At most one filename argument is allowed. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: Invalid option list: , +qemu-img: Invalid parameter 'snapshot.foo' +qemu-img: Failed in parsing snapshot param 'snapshot.foo' +qemu-img: --output must be used with human or json as argument. +qemu-img: Image size must be less than 8 EiB! +qemu-img: Unknown file format 'foo' + +=3D=3D Size calculation for a new file (human) =3D=3D + +required size: 196608 +fully allocated size: 196608 +required size: 589824 +fully allocated size: 2148073472 +required size: 10747904 +fully allocated size: 68730224640 +required size: 42205184 +fully allocated size: 274920112128 +required size: 168034304 +fully allocated size: 1099679662080 +qemu-img: The image size is too large (try using a larger cluster size) + +=3D=3D Empty qcow2 input image (human) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D0 +required size: 196608 +fully allocated size: 196608 + +converted image file size in bytes: 196608 + +=3D=3D qcow2 input image with data (human) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 +required size: 393216 +fully allocated size: 1074135040 +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 64512/64512 bytes at offset 134217728 +63 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +required size: 589824 +fully allocated size: 1074135040 + +converted image file size in bytes: 524288 + +=3D=3D qcow2 input image with internal snapshot (human) =3D=3D + +required size: 524288 +fully allocated size: 1074135040 + +converted image file size in bytes: 458752 + +=3D=3D qcow2 input image and a backing file (human) =3D=3D + +required size: 1074135040 +fully allocated size: 1074135040 + +=3D=3D qcow2 input image and preallocation (human) =3D=3D + +required size: 1074135040 +fully allocated size: 1074135040 + +converted image file size in bytes: 1074135040 + +=3D=3D Fully-allocated qcow2 input image (human) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8388608 +wrote 8388608/8388608 bytes at offset 0 +8 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +required size: 8716288 +fully allocated size: 8716288 + +converted image file size in bytes: 8716288 + +=3D=3D Empty raw input image (human) =3D=3D + +Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D0 +required size: 196608 +fully allocated size: 196608 + +converted image file size in bytes: 196608 + +=3D=3D raw input image with data (human) =3D=3D + +Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D1073741824 +required size: 393216 +fully allocated size: 1074135040 +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 64512/64512 bytes at offset 134217728 +63 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +required size: 589824 +fully allocated size: 1074135040 + +converted image file size in bytes: 524288 + +=3D=3D raw input image and a backing file (human) =3D=3D + +required size: 1074135040 +fully allocated size: 1074135040 + +=3D=3D raw input image and preallocation (human) =3D=3D + +required size: 1074135040 +fully allocated size: 1074135040 + +converted image file size in bytes: 1074135040 + +=3D=3D Fully-allocated raw input image (human) =3D=3D + +Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D8388608 +wrote 8388608/8388608 bytes at offset 0 +8 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +required size: 8716288 +fully allocated size: 8716288 + +converted image file size in bytes: 8716288 + +=3D=3D Size calculation for a new file (json) =3D=3D + +{ + "required": 196608, + "fully-allocated": 196608 +} +{ + "required": 589824, + "fully-allocated": 2148073472 +} +{ + "required": 10747904, + "fully-allocated": 68730224640 +} +{ + "required": 42205184, + "fully-allocated": 274920112128 +} +{ + "required": 168034304, + "fully-allocated": 1099679662080 +} +qemu-img: The image size is too large (try using a larger cluster size) + +=3D=3D Empty qcow2 input image (json) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D0 +{ + "required": 196608, + "fully-allocated": 196608 +} + +converted image file size in bytes: 196608 + +=3D=3D qcow2 input image with data (json) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 +{ + "required": 393216, + "fully-allocated": 1074135040 +} +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 64512/64512 bytes at offset 134217728 +63 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ + "required": 589824, + "fully-allocated": 1074135040 +} + +converted image file size in bytes: 524288 + +=3D=3D qcow2 input image with internal snapshot (json) =3D=3D + +{ + "required": 524288, + "fully-allocated": 1074135040 +} + +converted image file size in bytes: 458752 + +=3D=3D qcow2 input image and a backing file (json) =3D=3D + +{ + "required": 1074135040, + "fully-allocated": 1074135040 +} + +=3D=3D qcow2 input image and preallocation (json) =3D=3D + +{ + "required": 1074135040, + "fully-allocated": 1074135040 +} + +converted image file size in bytes: 1074135040 + +=3D=3D Fully-allocated qcow2 input image (json) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8388608 +wrote 8388608/8388608 bytes at offset 0 +8 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ + "required": 8716288, + "fully-allocated": 8716288 +} + +converted image file size in bytes: 8716288 + +=3D=3D Empty raw input image (json) =3D=3D + +Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D0 +{ + "required": 196608, + "fully-allocated": 196608 +} + +converted image file size in bytes: 196608 + +=3D=3D raw input image with data (json) =3D=3D + +Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D1073741824 +{ + "required": 393216, + "fully-allocated": 1074135040 +} +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 64512/64512 bytes at offset 134217728 +63 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ + "required": 589824, + "fully-allocated": 1074135040 +} + +converted image file size in bytes: 524288 + +=3D=3D raw input image and a backing file (json) =3D=3D + +{ + "required": 1074135040, + "fully-allocated": 1074135040 +} + +=3D=3D raw input image and preallocation (json) =3D=3D + +{ + "required": 1074135040, + "fully-allocated": 1074135040 +} + +converted image file size in bytes: 1074135040 + +=3D=3D Fully-allocated raw input image (json) =3D=3D + +Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D8388608 +wrote 8388608/8388608 bytes at offset 0 +8 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ + "required": 8716288, + "fully-allocated": 8716288 +} + +converted image file size in bytes: 8716288 +*** done diff --git a/tests/qemu-iotests/178.out.raw b/tests/qemu-iotests/178.out.raw new file mode 100644 index 0000000..5c0907a --- /dev/null +++ b/tests/qemu-iotests/178.out.raw @@ -0,0 +1,152 @@ +QA output created by 178 +=3D=3D Input validation =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 +qemu-img: Either --size N or one filename must be specified. +qemu-img: --size N cannot be used together with a filename. +qemu-img: At most one filename argument is allowed. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: --object, --image-opts, -f, and -l require a filename argument. +qemu-img: Invalid option list: , +qemu-img: Invalid parameter 'snapshot.foo' +qemu-img: Failed in parsing snapshot param 'snapshot.foo' +qemu-img: --output must be used with human or json as argument. +qemu-img: Image size must be less than 8 EiB! +qemu-img: Unknown file format 'foo' + +=3D=3D Size calculation for a new file (human) =3D=3D + +required size: 0 +fully allocated size: 0 +required size: 2147483648 +fully allocated size: 2147483648 +required size: 68719476736 +fully allocated size: 68719476736 +required size: 274877906944 +fully allocated size: 274877906944 +required size: 1099511627776 +fully allocated size: 1099511627776 +required size: 8070450532247928832 +fully allocated size: 8070450532247928832 + +=3D=3D Empty raw input image (human) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D0 +required size: 0 +fully allocated size: 0 + +converted image file size in bytes: 0 + +=3D=3D raw input image with data (human) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 +required size: 1073741824 +fully allocated size: 1073741824 +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 64512/64512 bytes at offset 134217728 +63 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +required size: 1073741824 +fully allocated size: 1073741824 + +converted image file size in bytes: 1073741824 + +=3D=3D raw input image and preallocation (human) =3D=3D + +required size: 1073741824 +fully allocated size: 1073741824 + +converted image file size in bytes: 1073741824 + +=3D=3D Fully-allocated raw input image (human) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8388608 +wrote 8388608/8388608 bytes at offset 0 +8 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +required size: 8388608 +fully allocated size: 8388608 + +converted image file size in bytes: 8388608 + +=3D=3D Size calculation for a new file (json) =3D=3D + +{ + "required": 0, + "fully-allocated": 0 +} +{ + "required": 2147483648, + "fully-allocated": 2147483648 +} +{ + "required": 68719476736, + "fully-allocated": 68719476736 +} +{ + "required": 274877906944, + "fully-allocated": 274877906944 +} +{ + "required": 1099511627776, + "fully-allocated": 1099511627776 +} +{ + "required": 8070450532247928832, + "fully-allocated": 8070450532247928832 +} + +=3D=3D Empty raw input image (json) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D0 +{ + "required": 0, + "fully-allocated": 0 +} + +converted image file size in bytes: 0 + +=3D=3D raw input image with data (json) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824 +{ + "required": 1073741824, + "fully-allocated": 1073741824 +} +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 64512/64512 bytes at offset 134217728 +63 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ + "required": 1073741824, + "fully-allocated": 1073741824 +} + +converted image file size in bytes: 1073741824 + +=3D=3D raw input image and preallocation (json) =3D=3D + +{ + "required": 1073741824, + "fully-allocated": 1073741824 +} + +converted image file size in bytes: 1073741824 + +=3D=3D Fully-allocated raw input image (json) =3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8388608 +wrote 8388608/8388608 bytes at offset 0 +8 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ + "required": 8388608, + "fully-allocated": 8388608 +} + +converted image file size in bytes: 8388608 +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index a6acaff..3412b09 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -171,6 +171,7 @@ 175 auto quick 176 rw auto backing 177 rw auto quick +178 auto quick 179 rw auto quick 181 rw auto migration 182 rw auto quick --=20 2.9.4