qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth
@ 2009-07-06 13:59 Kevin Wolf
  2009-07-06 18:54 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2009-07-06 13:59 UTC (permalink / raw)
  To: hch; +Cc: Kevin Wolf, qemu-devel

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth
  2009-07-06 13:59 [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth Kevin Wolf
@ 2009-07-06 18:54 ` Christoph Hellwig
  2009-07-07  7:40   ` Kevin Wolf
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-07-06 18:54 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: hch, qemu-devel

On Mon, Jul 06, 2009 at 03:59:27PM +0200, Kevin Wolf wrote:
> 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.

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..

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth
  2009-07-06 18:54 ` Christoph Hellwig
@ 2009-07-07  7:40   ` Kevin Wolf
  2009-07-07 10:28     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2009-07-07  7:40 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: qemu-devel

Christoph Hellwig schrieb:
> On Mon, Jul 06, 2009 at 03:59:27PM +0200, Kevin Wolf wrote:
>> 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.
> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth
  2009-07-07  7:40   ` Kevin Wolf
@ 2009-07-07 10:28     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2009-07-07 10:28 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Christoph Hellwig, qemu-devel

On Tue, Jul 07, 2009 at 09:40:17AM +0200, Kevin Wolf wrote:
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-07 10:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-06 13:59 [Qemu-devel] [PATCH] qemu-iotests: Test L1 table growth Kevin Wolf
2009-07-06 18:54 ` Christoph Hellwig
2009-07-07  7:40   ` Kevin Wolf
2009-07-07 10:28     ` Christoph Hellwig

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).