From nobody Sun Oct 5 21:17: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 1493258217160212.55326625966188; Wed, 26 Apr 2017 18:56:57 -0700 (PDT) Received: from localhost ([::1]:57839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3Yfv-0007XT-LE for importer@patchew.org; Wed, 26 Apr 2017 21:56:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3YW4-0007a6-Se for qemu-devel@nongnu.org; Wed, 26 Apr 2017 21:46:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3YW2-00047F-Bp for qemu-devel@nongnu.org; Wed, 26 Apr 2017 21:46:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50604) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3YVz-00044S-3P; Wed, 26 Apr 2017 21:46:39 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01FB6A08EC; Thu, 27 Apr 2017 01:46:37 +0000 (UTC) Received: from red.redhat.com (ovpn-123-177.rdu2.redhat.com [10.10.123.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC28718114; Thu, 27 Apr 2017 01:46:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 01FB6A08EC 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=eblake@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 01FB6A08EC From: Eric Blake To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 20:46:17 -0500 Message-Id: <20170427014626.11553-9-eblake@redhat.com> In-Reply-To: <20170427014626.11553-1-eblake@redhat.com> References: <20170427014626.11553-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 27 Apr 2017 01:46:38 +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 v10 08/17] qemu-io: Switch 'map' output to byte-based reporting 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: kwolf@redhat.com, qemu-block@nongnu.org, mreitz@redhat.com 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" Mixing byte offset and sector allocation counts is a bit confusing. Also, reporting n/m sectors, where m decreases according to the remaining size of the file, isn't really adding any useful information. Update the output to use byte counts, and adjust the affected tests (./check -qcow2 102, ./check -vpc 146). Signed-off-by: Eric Blake Reviewed-by: Max Reitz --- v10: rebase to updated test 179 v9: new patch --- qemu-io-cmds.c | 5 ++--- tests/qemu-iotests/102.out | 4 ++-- tests/qemu-iotests/146.out | 30 +++++++++++++++--------------- tests/qemu-iotests/179.out | 22 +++++++++++----------- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 34f6707..40a3f2d 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1895,9 +1895,8 @@ static int map_f(BlockBackend *blk, int argc, char **= argv) retstr =3D ret ? " allocated" : "not allocated"; cvtstr(offset << 9ULL, s1, sizeof(s1)); - printf("[% 24" PRId64 "] % 8" PRId64 "/% 8" PRId64 " sectors %s " - "at offset %s (%d)\n", - offset << 9ULL, num, nb_sectors, retstr, s1, ret); + printf("[% 24" PRId64 "] % 16" PRId64 " bytes %s at offset %s (%d)= \n", + offset << 9ULL, num << 9ULL, retstr, s1, ret); offset +=3D num; nb_sectors -=3D num; diff --git a/tests/qemu-iotests/102.out b/tests/qemu-iotests/102.out index eecde16..0e0ae4c 100644 --- a/tests/qemu-iotests/102.out +++ b/tests/qemu-iotests/102.out @@ -6,7 +6,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D65536 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) Image resized. -[ 0] 128/ 128 sectors allocated at offs= et 0 bytes (1) +[ 0] 65536 bytes allocated at offset = 0 bytes (1) Offset Length Mapped to File =3D=3D=3D Testing map on an image file truncated outside of qemu =3D=3D=3D @@ -17,5 +17,5 @@ wrote 65536/65536 bytes at offset 0 Image resized. QEMU X.Y.Z monitor - type 'help' for more information (qemu) qemu-io drv0 map -[ 0] 128/ 128 sectors allocated at offs= et 0 bytes (1) +[ 0] 65536 bytes allocated at offset = 0 bytes (1) *** done diff --git a/tests/qemu-iotests/146.out b/tests/qemu-iotests/146.out index 4f334d8..d4e2f62 100644 --- a/tests/qemu-iotests/146.out +++ b/tests/qemu-iotests/146.out @@ -2,39 +2,39 @@ QA output created by 146 =3D=3D=3D Testing VPC Autodetect =3D=3D=3D -[ 0] 266334240/ 266334240 sectors not allocated at = offset 0 bytes (0) +[ 0] 136363130880 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Testing VPC with current_size force =3D=3D=3D -[ 0] 266338304/ 266338304 sectors not allocated at = offset 0 bytes (0) +[ 0] 136365211648 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Testing VPC with chs force =3D=3D=3D -[ 0] 266334240/ 266334240 sectors not allocated at = offset 0 bytes (0) +[ 0] 136363130880 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Testing Hyper-V Autodetect =3D=3D=3D -[ 0] 266338304/ 266338304 sectors not allocated at = offset 0 bytes (0) +[ 0] 136365211648 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Testing Hyper-V with current_size force =3D=3D=3D -[ 0] 266338304/ 266338304 sectors not allocated at = offset 0 bytes (0) +[ 0] 136365211648 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Testing Hyper-V with chs force =3D=3D=3D -[ 0] 266334240/ 266334240 sectors not allocated at = offset 0 bytes (0) +[ 0] 136363130880 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Testing d2v Autodetect =3D=3D=3D -[ 0] 514560/ 514560 sectors allocated at offs= et 0 bytes (1) +[ 0] 263454720 bytes allocated at offset = 0 bytes (1) =3D=3D=3D Testing d2v with current_size force =3D=3D=3D -[ 0] 514560/ 514560 sectors allocated at offs= et 0 bytes (1) +[ 0] 263454720 bytes allocated at offset = 0 bytes (1) =3D=3D=3D Testing d2v with chs force =3D=3D=3D -[ 0] 514560/ 514560 sectors allocated at offs= et 0 bytes (1) +[ 0] 263454720 bytes allocated at offset = 0 bytes (1) =3D=3D=3D Testing Image create, default =3D=3D=3D @@ -42,15 +42,15 @@ Formatting 'TEST_DIR/IMGFMT-create-test.IMGFMT', fmt=3D= IMGFMT size=3D4294967296 =3D=3D=3D Read created image, default opts =3D=3D=3D=3D -[ 0] 8389584/ 8389584 sectors not allocated at offs= et 0 bytes (0) +[ 0] 4295467008 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Read created image, force_size_calc=3Dchs =3D=3D=3D=3D -[ 0] 8389584/ 8389584 sectors not allocated at offs= et 0 bytes (0) +[ 0] 4295467008 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Read created image, force_size_calc=3Dcurrent_size =3D=3D=3D=3D -[ 0] 8389584/ 8389584 sectors not allocated at offs= et 0 bytes (0) +[ 0] 4295467008 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Testing Image create, force_size =3D=3D=3D @@ -58,13 +58,13 @@ Formatting 'TEST_DIR/IMGFMT-create-test.IMGFMT', fmt=3D= IMGFMT size=3D4294967296 forc =3D=3D=3D Read created image, default opts =3D=3D=3D=3D -[ 0] 8388608/ 8388608 sectors not allocated at offs= et 0 bytes (0) +[ 0] 4294967296 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Read created image, force_size_calc=3Dchs =3D=3D=3D=3D -[ 0] 8388608/ 8388608 sectors not allocated at offs= et 0 bytes (0) +[ 0] 4294967296 bytes not allocated at offset = 0 bytes (0) =3D=3D=3D Read created image, force_size_calc=3Dcurrent_size =3D=3D=3D=3D -[ 0] 8388608/ 8388608 sectors not allocated at offs= et 0 bytes (0) +[ 0] 4294967296 bytes not allocated at offset = 0 bytes (0) *** done diff --git a/tests/qemu-iotests/179.out b/tests/qemu-iotests/179.out index 2c3071b..33e9e3d 100644 --- a/tests/qemu-iotests/179.out +++ b/tests/qemu-iotests/179.out @@ -44,17 +44,17 @@ wrote 2097152/2097152 bytes at offset 60817408 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 2097152/2097152 bytes at offset 62914560 2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -[ 0] 4096/ 131072 sectors not allocated at offs= et 0 bytes (0) -[ 2097152] 4096/ 126976 sectors allocated at offs= et 2 MiB (1) -[ 4194304] 4096/ 122880 sectors not allocated at offs= et 4 MiB (0) -[ 6291456] 4096/ 118784 sectors allocated at offs= et 6 MiB (1) -[ 8388608] 4096/ 114688 sectors not allocated at offs= et 8 MiB (0) -[ 10485760] 4096/ 110592 sectors allocated at offs= et 10 MiB (1) -[ 12582912] 4096/ 106496 sectors not allocated at offs= et 12 MiB (0) -[ 14680064] 4096/ 102400 sectors allocated at offs= et 14 MiB (1) -[ 16777216] 4096/ 98304 sectors not allocated at offs= et 16 MiB (0) -[ 18874368] 77824/ 94208 sectors allocated at offs= et 18 MiB (1) -[ 58720256] 16384/ 16384 sectors not allocated at offs= et 56 MiB (0) +[ 0] 2097152 bytes not allocated at offset = 0 bytes (0) +[ 2097152] 2097152 bytes allocated at offset = 2 MiB (1) +[ 4194304] 2097152 bytes not allocated at offset = 4 MiB (0) +[ 6291456] 2097152 bytes allocated at offset = 6 MiB (1) +[ 8388608] 2097152 bytes not allocated at offset = 8 MiB (0) +[ 10485760] 2097152 bytes allocated at offset = 10 MiB (1) +[ 12582912] 2097152 bytes not allocated at offset = 12 MiB (0) +[ 14680064] 2097152 bytes allocated at offset = 14 MiB (1) +[ 16777216] 2097152 bytes not allocated at offset = 16 MiB (0) +[ 18874368] 39845888 bytes allocated at offset = 18 MiB (1) +[ 58720256] 8388608 bytes not allocated at offset = 56 MiB (0) [{ "start": 0, "length": 18874368, "depth": 1, "zero": true, "data": false= }, { "start": 18874368, "length": 2097152, "depth": 1, "zero": false, "data":= true, "offset": OFFSET}, { "start": 20971520, "length": 2097152, "depth": 1, "zero": true, "data": = false}, --=20 2.9.3