From: Kevin Wolf <kwolf@redhat.com>
To: hch@lst.de
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth
Date: Mon, 6 Jul 2009 15:59:27 +0200 [thread overview]
Message-ID: <1246888767-29072-1-git-send-email-kwolf@redhat.com> (raw)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
I don't really like about this one that it contains the monitor echo of our
commands from stdin. It contains lots of control characters and who knows if
the monitor won't change to do a more reasonable echo some time... However, we
need the monitor output to see if an error occured during savevm or loadvm. So,
I'm open for suggestions, but in case nobody has a better option, let's do it
this way.
016 | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
016.out | 15 +++++++++++
common.filter | 6 ++++
group | 1 +
4 files changed, 99 insertions(+), 0 deletions(-)
create mode 100755 016
create mode 100644 016.out
diff --git a/016 b/016
new file mode 100755
index 0000000..5cb2080
--- /dev/null
+++ b/016
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# Grow the L1 table
+#
+# Copyright (C) 2009 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+#
+
+# creator
+owner=kwolf@redhat.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+_cleanup()
+{
+# _cleanup_test_img
+ true
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# currently only qcow2 allows for consistency checks using qemu-img
+_supported_fmt qcow2
+_supported_os Linux
+
+echo
+echo "creating image"
+
+# For 4k cluster, an L2 table spans 2M of the virtual disk
+# To trigger an L1 table growth it is enough to have the image size 2M aligned
+# and write a snapshot with VM data.
+size=2M
+_make_test_img -o cluster_size=4k $size
+
+# Create a snapshot with VM state
+echo "creating first snapshot"
+$QEMU -hda $TEST_IMG -monitor stdio <<EOF 2>&1 | _filter_qemu
+savevm test
+quit
+EOF
+
+# Try to load it again
+$QEMU -hda $TEST_IMG -monitor stdio <<EOF 2>&1 | _filter_qemu
+loadvm test
+quit
+EOF
+
+echo
+echo "checking image for errors"
+_check_test_img
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/016.out b/016.out
new file mode 100644
index 0000000..0554d54
--- /dev/null
+++ b/016.out
@@ -0,0 +1,15 @@
+QA output created by 016
+
+creating image
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2097152 cluster_size=4096
+creating first snapshot
+s^[[K^[[Dsa^[[K^[[D^[[Dsav^[[K^[[D^[[D^[[Dsave^[[K^[[D^[[D^[[D^[[Dsavev^[[K^[[D^[[D^[[D^[[D^[[Dsavevm^[[K^[[D^[[D^[[D^[[D^[[D^[[Dsavevm ^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[Dsavevm t^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[Dsavevm te^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[Dsavevm tes^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[Dsavevm test^[[K
+QEMU monitor - type 'help' for more information
+(qemu) (qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+l^[[K^[[Dlo^[[K^[[D^[[Dloa^[[K^[[D^[[D^[[Dload^[[K^[[D^[[D^[[D^[[Dloadv^[[K^[[D^[[D^[[D^[[D^[[Dloadvm^[[K^[[D^[[D^[[D^[[D^[[D^[[Dloadvm ^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[Dloadvm t^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[Dloadvm te^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[Dloadvm tes^[[K^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[Dloadvm test^[[K
+QEMU monitor - type 'help' for more information
+(qemu) (qemu) q^[[K^[[Dqu^[[K^[[D^[[Dqui^[[K^[[D^[[D^[[Dquit^[[K
+
+checking image for errors
+No errors were found on the image.
+*** done
diff --git a/common.filter b/common.filter
index b12f50b..dc90fa4 100644
--- a/common.filter
+++ b/common.filter
@@ -141,5 +141,11 @@ _filter_qemu_io()
sed -e "s/[0-9]* ops\; [0-9/:. sec]* ([0-9/.]* [GMKiBbytes]*\/sec and [0-9/.]* ops\/sec)/X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
}
+# sanitize qemu output
+_filter_qemu()
+{
+ sed -e "s/QEMU [0-9.]* monitor/QEMU monitor/" | grep -v -e kqemu -e kvm
+}
+
# make sure this script returns success
/bin/true
diff --git a/group b/group
index 3beb952..3dfcb7b 100644
--- a/group
+++ b/group
@@ -22,3 +22,4 @@
013 rw auto
014 rw auto
015 rw snapshot auto
+016 snapshot auto
--
1.6.0.6
next reply other threads:[~2009-07-06 14:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 13:59 Kevin Wolf [this message]
2009-07-06 18:54 ` [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth Christoph Hellwig
2009-07-07 7:40 ` Kevin Wolf
2009-07-07 10:28 ` Christoph Hellwig
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=1246888767-29072-1-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=hch@lst.de \
--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).