From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB4rr-00080Z-By for qemu-devel@nongnu.org; Tue, 13 Jan 2015 12:03:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YB4rm-0004jW-3P for qemu-devel@nongnu.org; Tue, 13 Jan 2015 12:02:59 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:47317 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YB4rl-0004ip-8Y for qemu-devel@nongnu.org; Tue, 13 Jan 2015 12:02:53 -0500 From: Vladimir Sementsov-Ogievskiy Date: Tue, 13 Jan 2015 20:02:25 +0300 Message-Id: <1421168546-6232-9-git-send-email-vsementsov@parallels.com> In-Reply-To: <1421168546-6232-1-git-send-email-vsementsov@parallels.com> References: <1421168546-6232-1-git-send-email-vsementsov@parallels.com> Subject: [Qemu-devel] [PATCH 8/8] iotests: test internal persistent dirty bitmap List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, vsementsov@parallels.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org, jsnow@redhat.com The test performs several vm reloads with checking and updating dirty bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/115 | 96 ++++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/115.out | 64 +++++++++++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 161 insertions(+) create mode 100755 tests/qemu-iotests/115 create mode 100644 tests/qemu-iotests/115.out diff --git a/tests/qemu-iotests/115 b/tests/qemu-iotests/115 new file mode 100755 index 0000000..ef853b1 --- /dev/null +++ b/tests/qemu-iotests/115 @@ -0,0 +1,96 @@ +#!/bin/bash +# +# Persistent dirty bitmap test +# +# Performs several vm reloads with checking and updating dirty bitmap. +# +# Copyright (C) 2014 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, see . +# + +# creator +owner=vsementsov@parallels.com + +seq=`basename $0` +echo "QA output created by $seq" + +here=`pwd` +status=1 # failure is the default! + +_cleanup() +{ + _cleanup_qemu + _cleanup_test_img +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.qemu + +_supported_fmt qcow2 +_supported_os Linux + +size=1G +_make_test_img $size + +qemu_comm_method="monitor" + +launch() { + _launch_qemu -drive file="${TEST_IMG}",id=disk\ + -dirty-bitmap name=bitmap,drive=disk + echo + echo START VM +} + +print_bitmap() { + _send_qemu_cmd $QEMU_HANDLE 'print_dirty_bitmap disk bitmap'\ + "dirty regions end" | sed 's/^/ /' +} + +write() { + _send_qemu_cmd $QEMU_HANDLE 'qemu-io disk "write ' $@ '"' "(qemu)" + echo + echo write $@ +} + +quit() { + _send_qemu_cmd $QEMU_HANDLE 'qemu-io disk flush' "(qemu)" + _send_qemu_cmd $QEMU_HANDLE 'quit' "" + echo QUIT + wait ${QEMU_PID[$QEMU_HANDLE]} 2>/dev/null +} + +{ + launch + print_bitmap + write 50m 1m + print_bitmap + quit + + launch + print_bitmap + write 0m 10m + write 700m 200m + print_bitmap + quit + + launch + print_bitmap + quit +} | sed '/(qemu)/d' + +status=0 diff --git a/tests/qemu-iotests/115.out b/tests/qemu-iotests/115.out new file mode 100644 index 0000000..d570c9f --- /dev/null +++ b/tests/qemu-iotests/115.out @@ -0,0 +1,64 @@ +QA output created by 115 +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 + +START VM +QEMU X.Y.Z monitor - type 'help' for more information + bitmap 'bitmap' + enabled: true + size: 2097152 + granularity: 65536 + dirty regions begin: + dirty regions end + +write 50m 1m +wrote 1048576/1048576 bytes at offset 52428800 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + bitmap 'bitmap' + enabled: true + size: 2097152 + granularity: 65536 + dirty regions begin: + 102400 -> 104447 + dirty regions end +QUIT + +START VM +QEMU X.Y.Z monitor - type 'help' for more information + bitmap 'bitmap' + enabled: true + size: 2097152 + granularity: 65536 + dirty regions begin: + 102400 -> 104447 + dirty regions end + +write 0m 10m +wrote 10485760/10485760 bytes at offset 0 +10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +write 700m 200m +wrote 209715200/209715200 bytes at offset 734003200 +200 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + bitmap 'bitmap' + enabled: true + size: 2097152 + granularity: 65536 + dirty regions begin: + 0 -> 20479 + 102400 -> 104447 + 1433600 -> 1843199 + dirty regions end +QUIT + +START VM +QEMU X.Y.Z monitor - type 'help' for more information + bitmap 'bitmap' + enabled: true + size: 2097152 + granularity: 65536 + dirty regions begin: + 0 -> 20479 + 102400 -> 104447 + 1433600 -> 1843199 + dirty regions end +QUIT diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index a4742c6..77377b3 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -115,3 +115,4 @@ 111 rw auto quick 113 rw auto quick 114 rw auto quick +115 rw auto quick -- 1.9.1