From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEMaQ-00009x-0L for qemu-devel@nongnu.org; Fri, 14 Feb 2014 12:30:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEMaJ-0004aE-9R for qemu-devel@nongnu.org; Fri, 14 Feb 2014 12:30:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEMaI-0004Zh-Vl for qemu-devel@nongnu.org; Fri, 14 Feb 2014 12:29:55 -0500 From: Stefan Hajnoczi Date: Fri, 14 Feb 2014 18:29:28 +0100 Message-Id: <1392398973-15092-7-git-send-email-stefanha@redhat.com> In-Reply-To: <1392398973-15092-1-git-send-email-stefanha@redhat.com> References: <1392398973-15092-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 06/11] block: qemu-iotests - add vhdx log replay tests for qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori From: Jeff Cody VHDX logs can now be replayed via 'qemu-img check -r all'. Add tests to verify that the log replay is successful when using qemu-img. Signed-off-by: Jeff Cody Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/070 | 10 ++++++++++ tests/qemu-iotests/070.out | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070 index f84d2cb..ce71fa4 100755 --- a/tests/qemu-iotests/070 +++ b/tests/qemu-iotests/070 @@ -62,6 +62,16 @@ $QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | _filter_testdir \ echo "=== Verify open image replays log ===" $QEMU_IO -c "read -pP 0xa5 0 18M" "$TEST_IMG" | _filter_qemu_io +# extract fresh sample image again +_use_sample_img iotest-dirtylog-10G-4M.vhdx.bz2 + +echo "=== Verify qemu-img check -r all replays log ===" +$QEMU_IMG check -r all "$TEST_IMG" 2>&1 | _filter_testdir | _filter_qemu + +echo "=== Verify open image read-only succeeds after log replay ===" +$QEMU_IO -r -c "read -pP 0xa5 0 18M" "$TEST_IMG" 2>&1 | _filter_testdir \ + | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out index 0352adc..922d62c 100644 --- a/tests/qemu-iotests/070.out +++ b/tests/qemu-iotests/070.out @@ -7,4 +7,15 @@ qemu-io: can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image file === Verify open image replays log === read 18874368/18874368 bytes at offset 0 18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +=== Verify qemu-img check -r all replays log === +The following inconsistencies were found and repaired: + + 0 leaked clusters + 1 corruptions + +Double checking the fixed image now... +No errors were found on the image. +=== Verify open image read-only succeeds after log replay === +read 18874368/18874368 bytes at offset 0 +18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) *** done -- 1.8.5.3