From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MNokQ-0006vI-Rc for qemu-devel@nongnu.org; Mon, 06 Jul 2009 10:00:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MNokM-0006tK-DR for qemu-devel@nongnu.org; Mon, 06 Jul 2009 10:00:46 -0400 Received: from [199.232.76.173] (port=51235 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MNokL-0006tA-VF for qemu-devel@nongnu.org; Mon, 06 Jul 2009 10:00:42 -0400 Received: from mx2.redhat.com ([66.187.237.31]:46304) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MNokL-0002uk-4U for qemu-devel@nongnu.org; Mon, 06 Jul 2009 10:00:41 -0400 From: Kevin Wolf Date: Mon, 6 Jul 2009 15:59:27 +0200 Message-Id: <1246888767-29072-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: hch@lst.de Cc: Kevin Wolf , qemu-devel@nongnu.org Signed-off-by: Kevin Wolf --- 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 <&1 | _filter_qemu +savevm test +quit +EOF + +# Try to load it again +$QEMU -hda $TEST_IMG -monitor stdio <&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 +ssasavsavesavevsavevmsavevm savevm tsavevm tesavevm tessavevm test +QEMU monitor - type 'help' for more information +(qemu) (qemu) qququiquit +lloloaloadloadvloadvmloadvm loadvm tloadvm teloadvm tesloadvm test +QEMU monitor - type 'help' for more information +(qemu) (qemu) qququiquit + +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