qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	Alberto Garcia <berto@igalia.com>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] [PATCH 2/3] iotests: qcow2 COW with minimal L2 cache size
Date: Mon,  1 Jun 2015 18:09:18 +0200	[thread overview]
Message-ID: <1433174959-7176-3-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1433174959-7176-1-git-send-email-mreitz@redhat.com>

This adds a test case to test 103 for performing a COW operation in a
qcow2 image using an L2 cache with minimal size (which should be at
least two clusters so the COW can access both source and destination
simultaneously).

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/103     | 10 ++++++++++
 tests/qemu-iotests/103.out |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/tests/qemu-iotests/103 b/tests/qemu-iotests/103
index ccab551..fa9a3c1 100755
--- a/tests/qemu-iotests/103
+++ b/tests/qemu-iotests/103
@@ -93,6 +93,16 @@ $QEMU_IO -c "open -o l2-cache-size=1M,refcount-cache-size=0.25M $TEST_IMG" \
          -c 'read -P 42 0 64k' \
     | _filter_qemu_io
 
+echo
+echo '=== Testing minimal L2 cache and COW ==='
+echo
+
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
+# This requires a COW operation, which accesses two L2 tables simultaneously
+# (COW source and destination), so there must be enough space in the cache to
+# place both tables there (and qemu should not crash)
+$QEMU_IO -c "open -o cache-size=0 $TEST_IMG" -c 'write 0 64k' | _filter_qemu_io
+
 # success, all done
 echo '*** done'
 rm -f $seq.full
diff --git a/tests/qemu-iotests/103.out b/tests/qemu-iotests/103.out
index ee705b0..d05f49f 100644
--- a/tests/qemu-iotests/103.out
+++ b/tests/qemu-iotests/103.out
@@ -26,4 +26,9 @@ read 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 read 65536/65536 bytes at offset 0
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+=== Testing minimal L2 cache and COW ===
+
+wrote 65536/65536 bytes at offset 0
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 *** done
-- 
2.4.1

  parent reply	other threads:[~2015-06-01 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 16:09 [Qemu-devel] [PATCH 0/3] qcow2: Fix MIN_L2_CACHE_SIZE Max Reitz
2015-06-01 16:09 ` [Qemu-devel] [PATCH 1/3] qcow2: Set MIN_L2_CACHE_SIZE to 2 Max Reitz
2015-06-01 16:10   ` Max Reitz
2015-06-01 16:12   ` Alexander Graf
2015-06-01 16:14   ` Alberto Garcia
2015-06-01 16:09 ` Max Reitz [this message]
2015-06-01 17:01   ` [Qemu-devel] [PATCH 2/3] iotests: qcow2 COW with minimal L2 cache size Alberto Garcia
2015-06-01 16:09 ` [Qemu-devel] [PATCH 3/3] qcow2: Add DEFAULT_L2_CACHE_CLUSTERS Max Reitz
2015-06-01 17:16   ` Alberto Garcia
2015-06-02  9:31 ` [Qemu-devel] [PATCH 0/3] qcow2: Fix MIN_L2_CACHE_SIZE Kevin Wolf

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=1433174959-7176-3-git-send-email-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=agraf@suse.de \
    --cc=berto@igalia.com \
    --cc=kwolf@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).