qemu-iotests: Test L1 table growth
PATCH 1/1 qemu-iotests: Test L1 table growth
---
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
016 new file +77 -0
@@ -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 [email protected] + +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
016.out new file +15 -0
@@ -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
common.filter +6 -0
@@ -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
group +1 -0
@@ -22,3 +22,4 @@ 013 rw auto 014 rw auto 015 rw snapshot auto +016 snapshot auto
Signature · 1 line
1.6.0.6
Quoted 8 lines · Kevin Wolf
Signed-off-by Kevin Wolf <[email protected]>---
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.
It does fail for me because I get different escape sequences..
I suspect we'll just have to wait until Luiz' gets a proper machine-readable protocol for the monitor in and then use that one. And pray that we'll stick with the text protocol instead of some rpc crap..
Quoted 10 lines · Christoph Hellwig
Quoted 8 lines · Kevin Wolf
Signed-off-by Kevin Wolf <[email protected]>---
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.
Quoted 6 lines
It does fail for me because I get different escape sequences..
I suspect we'll just have to wait until Luiz' gets a proper machine-readable protocol for the monitor in and then use that one. And pray that we'll stick with the text protocol instead of some rpc crap..
Ok, so using qemu in our tests is basically impossible because we can't get any status messages. Bad news.
For this one we can handle it differently: I'll implement bdrv_get/put_buffer in qemu-io, this should be more or less the same to the image format drivers. We even get more control over the data written, so I guess this is the better approach anyway.
Kevin
Quoted 7 lines · Kevin Wolf
Ok, so using qemu in our tests is basically impossible because we can't get any status messages. Bad news.
For this one we can handle it differently: I'll implement bdrv_get/put_buffer in qemu-io, this should be more or less the same to the image format drivers. We even get more control over the data written, so I guess this is the better approach anyway.
Yes, that's a very good plan.