From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, kwolf@redhat.com, mreitz@redhat.com
Subject: [Qemu-devel] [PATCH v9 04/13] qemu-io: Switch 'map' output to byte-based reporting
Date: Mon, 10 Apr 2017 20:17:09 -0500 [thread overview]
Message-ID: <20170411011718.9152-5-eblake@redhat.com> (raw)
In-Reply-To: <20170411011718.9152-1-eblake@redhat.com>
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 <eblake@redhat.com>
---
qemu-io-cmds.c | 5 ++---
tests/qemu-iotests/102.out | 4 ++--
tests/qemu-iotests/146.out | 30 +++++++++++++++---------------
3 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index df7297f..ed79c30 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 = 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 += num;
nb_sectors -= 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=IMGFMT size=65536
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 offset 0 bytes (1)
+[ 0] 65536 bytes allocated at offset 0 bytes (1)
Offset Length Mapped to File
=== Testing map on an image file truncated outside of qemu ===
@@ -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 offset 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
=== Testing VPC Autodetect ===
-[ 0] 266334240/ 266334240 sectors not allocated at offset 0 bytes (0)
+[ 0] 136363130880 bytes not allocated at offset 0 bytes (0)
=== Testing VPC with current_size force ===
-[ 0] 266338304/ 266338304 sectors not allocated at offset 0 bytes (0)
+[ 0] 136365211648 bytes not allocated at offset 0 bytes (0)
=== Testing VPC with chs force ===
-[ 0] 266334240/ 266334240 sectors not allocated at offset 0 bytes (0)
+[ 0] 136363130880 bytes not allocated at offset 0 bytes (0)
=== Testing Hyper-V Autodetect ===
-[ 0] 266338304/ 266338304 sectors not allocated at offset 0 bytes (0)
+[ 0] 136365211648 bytes not allocated at offset 0 bytes (0)
=== Testing Hyper-V with current_size force ===
-[ 0] 266338304/ 266338304 sectors not allocated at offset 0 bytes (0)
+[ 0] 136365211648 bytes not allocated at offset 0 bytes (0)
=== Testing Hyper-V with chs force ===
-[ 0] 266334240/ 266334240 sectors not allocated at offset 0 bytes (0)
+[ 0] 136363130880 bytes not allocated at offset 0 bytes (0)
=== Testing d2v Autodetect ===
-[ 0] 514560/ 514560 sectors allocated at offset 0 bytes (1)
+[ 0] 263454720 bytes allocated at offset 0 bytes (1)
=== Testing d2v with current_size force ===
-[ 0] 514560/ 514560 sectors allocated at offset 0 bytes (1)
+[ 0] 263454720 bytes allocated at offset 0 bytes (1)
=== Testing d2v with chs force ===
-[ 0] 514560/ 514560 sectors allocated at offset 0 bytes (1)
+[ 0] 263454720 bytes allocated at offset 0 bytes (1)
=== Testing Image create, default ===
@@ -42,15 +42,15 @@ Formatting 'TEST_DIR/IMGFMT-create-test.IMGFMT', fmt=IMGFMT size=4294967296
=== Read created image, default opts ====
-[ 0] 8389584/ 8389584 sectors not allocated at offset 0 bytes (0)
+[ 0] 4295467008 bytes not allocated at offset 0 bytes (0)
=== Read created image, force_size_calc=chs ====
-[ 0] 8389584/ 8389584 sectors not allocated at offset 0 bytes (0)
+[ 0] 4295467008 bytes not allocated at offset 0 bytes (0)
=== Read created image, force_size_calc=current_size ====
-[ 0] 8389584/ 8389584 sectors not allocated at offset 0 bytes (0)
+[ 0] 4295467008 bytes not allocated at offset 0 bytes (0)
=== Testing Image create, force_size ===
@@ -58,13 +58,13 @@ Formatting 'TEST_DIR/IMGFMT-create-test.IMGFMT', fmt=IMGFMT size=4294967296 forc
=== Read created image, default opts ====
-[ 0] 8388608/ 8388608 sectors not allocated at offset 0 bytes (0)
+[ 0] 4294967296 bytes not allocated at offset 0 bytes (0)
=== Read created image, force_size_calc=chs ====
-[ 0] 8388608/ 8388608 sectors not allocated at offset 0 bytes (0)
+[ 0] 4294967296 bytes not allocated at offset 0 bytes (0)
=== Read created image, force_size_calc=current_size ====
-[ 0] 8388608/ 8388608 sectors not allocated at offset 0 bytes (0)
+[ 0] 4294967296 bytes not allocated at offset 0 bytes (0)
*** done
--
2.9.3
next prev parent reply other threads:[~2017-04-11 1:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 1:17 [Qemu-devel] [PATCH for-2.10 v9 00/13] add blkdebug tests Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 01/13] qcow2: Unallocate unmapped zero clusters if no backing file Eric Blake
2017-04-12 9:49 ` Kevin Wolf
2017-04-12 13:32 ` Eric Blake
2017-04-21 18:42 ` Eric Blake
2017-05-11 14:56 ` Eric Blake
2017-05-11 15:18 ` Eric Blake
2017-05-12 16:06 ` Max Reitz
2017-05-12 23:00 ` John Snow
2017-05-15 18:35 ` Max Reitz
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 02/13] iotests: Add test 179 to cover write zeroes with unmap Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 03/13] qemu-io: Switch 'alloc' command to byte-based length Eric Blake
2017-04-11 2:37 ` Philippe Mathieu-Daudé
2017-04-11 12:11 ` Eric Blake
2017-04-11 1:17 ` Eric Blake [this message]
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 05/13] qcow2: Optimize write zero of unaligned tail cluster Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 06/13] qcow2: Assert that cluster operations are aligned Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 07/13] qcow2: Discard/zero clusters by byte count Eric Blake
2017-04-11 22:12 ` Eric Blake
2017-04-11 22:15 ` [Qemu-devel] [PATCH v9.5 07/13] fixup! " Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 08/13] blkdebug: Sanity check block layer guarantees Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 09/13] blkdebug: Refactor error injection Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 10/13] blkdebug: Add pass-through write_zero and discard support Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 11/13] blkdebug: Simplify override logic Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 12/13] blkdebug: Add ability to override unmap geometries Eric Blake
2017-04-11 1:17 ` [Qemu-devel] [PATCH v9 13/13] tests: Add coverage for recent block geometry fixes Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170411011718.9152-5-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).