qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Drobyshev via <qemu-devel@nongnu.org>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, stefanha@redhat.com, kwolf@redhat.com,
	hreitz@redhat.com, andrey.drobyshev@virtuozzo.com,
	den@virtuozzo.com
Subject: [PATCH v2 4/3] qemu-iotests/197: use more generic commands for formats other than qcow2
Date: Fri,  8 Sep 2023 01:07:18 +0300	[thread overview]
Message-ID: <20230907220718.983430-1-andrey.drobyshev@virtuozzo.com> (raw)
In-Reply-To: <20230711172553.234055-1-andrey.drobyshev@virtuozzo.com>

In the previous commit e2f938265e0 ("tests/qemu-iotests/197: add
testcase for CoR with subclusters") we've introduced a new testcase for
copy-on-read with subclusters.  Test 197 always forces qcow2 as the top
image, but allows backing image to be in any format.  That last test
case didn't meet these requirements, so let's fix it by using more
generic "qemu-io -c map" command.

Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
 tests/qemu-iotests/197     |  8 ++++----
 tests/qemu-iotests/197.out | 18 ++++++++----------
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197
index f07a9da136..8ad2bdb035 100755
--- a/tests/qemu-iotests/197
+++ b/tests/qemu-iotests/197
@@ -136,18 +136,18 @@ IMGPROTO=file IMGFMT=qcow2 TEST_IMG_FILE="$TEST_WRAP" \
 $QEMU_IO -c "write -P 0xaa 0 64k" "$TEST_IMG" | _filter_qemu_io
 
 # Allocate individual subclusters in the top image, and not the whole cluster
-$QEMU_IO -c "write -P 0xbb 28K 2K" -c "write -P 0xcc 34K 2K" "$TEST_WRAP" \
+$QEMU_IO -f qcow2 -c "write -P 0xbb 28K 2K" -c "write -P 0xcc 34K 2K" "$TEST_WRAP" \
     | _filter_qemu_io
 
 # Only 2 subclusters should be allocated in the top image at this point
-$QEMU_IMG map "$TEST_WRAP" | _filter_qemu_img_map
+$QEMU_IO -f qcow2 -c map "$TEST_WRAP"
 
 # Actual copy-on-read operation
-$QEMU_IO -C -c "read -P 0xaa 30K 4K" "$TEST_WRAP" | _filter_qemu_io
+$QEMU_IO -f qcow2 -C -c "read -P 0xaa 30K 4K" "$TEST_WRAP" | _filter_qemu_io
 
 # And here we should have 4 subclusters allocated right in the middle of the
 # top image. Make sure the whole cluster remains unallocated
-$QEMU_IMG map "$TEST_WRAP" | _filter_qemu_img_map
+$QEMU_IO -f qcow2 -c map "$TEST_WRAP"
 
 _check_test_img
 
diff --git a/tests/qemu-iotests/197.out b/tests/qemu-iotests/197.out
index 8f34a30afe..86c57b51d3 100644
--- a/tests/qemu-iotests/197.out
+++ b/tests/qemu-iotests/197.out
@@ -42,17 +42,15 @@ wrote 2048/2048 bytes at offset 28672
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 wrote 2048/2048 bytes at offset 34816
 2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Offset          Length          File
-0               0x7000          TEST_DIR/t.IMGFMT
-0x7000          0x800           TEST_DIR/t.wrap.IMGFMT
-0x7800          0x1000          TEST_DIR/t.IMGFMT
-0x8800          0x800           TEST_DIR/t.wrap.IMGFMT
-0x9000          0x7000          TEST_DIR/t.IMGFMT
+28 KiB (0x7000) bytes not allocated at offset 0 bytes (0x0)
+2 KiB (0x800) bytes     allocated at offset 28 KiB (0x7000)
+4 KiB (0x1000) bytes not allocated at offset 30 KiB (0x7800)
+2 KiB (0x800) bytes     allocated at offset 34 KiB (0x8800)
+28 KiB (0x7000) bytes not allocated at offset 36 KiB (0x9000)
 read 4096/4096 bytes at offset 30720
 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Offset          Length          File
-0               0x7000          TEST_DIR/t.IMGFMT
-0x7000          0x2000          TEST_DIR/t.wrap.IMGFMT
-0x9000          0x7000          TEST_DIR/t.IMGFMT
+28 KiB (0x7000) bytes not allocated at offset 0 bytes (0x0)
+8 KiB (0x2000) bytes     allocated at offset 28 KiB (0x7000)
+28 KiB (0x7000) bytes not allocated at offset 36 KiB (0x9000)
 No errors were found on the image.
 *** done
-- 
2.39.3



  parent reply	other threads:[~2023-09-07 22:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 17:25 [PATCH v2 0/3] block: align CoR requests to subclusters Andrey Drobyshev via
2023-07-11 17:25 ` [PATCH v2 1/3] block: add subcluster_size field to BlockDriverInfo Andrey Drobyshev via
2023-07-26  8:58   ` Vladimir Sementsov-Ogievskiy
2023-07-11 17:25 ` [PATCH v2 2/3] block/io: align requests to subcluster_size Andrey Drobyshev via
2023-07-26  9:14   ` Vladimir Sementsov-Ogievskiy
2023-07-11 17:25 ` [PATCH v2 3/3] tests/qemu-iotests/197: add testcase for CoR with subclusters Andrey Drobyshev via
2023-07-26  9:26   ` Vladimir Sementsov-Ogievskiy
2023-09-06  9:43   ` Denis V. Lunev
2023-09-07 22:11     ` Andrey Drobyshev
2023-07-24 13:11 ` [PATCH v2 0/3] block: align CoR requests to subclusters Andrey Drobyshev
2023-07-31 14:51   ` Andrey Drobyshev
2023-08-16  9:22     ` Andrey Drobyshev
2023-08-22 17:34       ` Andrey Drobyshev
2023-08-22 19:58         ` John Snow
2023-08-23 12:50           ` Andrey Drobyshev
2023-08-24 14:32             ` Stefan Hajnoczi
2023-08-24 15:47               ` Andrey Drobyshev
2023-08-24 17:19                 ` Stefan Hajnoczi
2023-08-16 13:52 ` Stefan Hajnoczi
2023-09-07 20:11 ` Michael Tokarev
2023-09-07 22:10   ` Denis V. Lunev
2023-09-07 22:07 ` Andrey Drobyshev via [this message]
2023-09-08  0:15   ` [PATCH v2 4/3] qemu-iotests/197: use more generic commands for formats other than qcow2 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=20230907220718.983430-1-andrey.drobyshev@virtuozzo.com \
    --to=qemu-devel@nongnu.org \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=den@virtuozzo.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).