@@ -31,6 +31,11 @@ status=1 # failure is the default!
_cleanup()
{
_cleanup_test_img
+
+ if [ -n "$TEST_IMG_BASE" ]
+ then
+ rm -f "$TEST_IMG_BASE"
+ fi
}
trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -87,6 +92,22 @@ _use_sample_img parallels-v2-padded.bz2
_use_sample_img parallels-padded.xml.bz2
{ $QEMU_IO -c "read -P 0x11 0 64k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo
+echo "== Read from an image with a backing image =="
+TEST_IMG_BASE="$TEST_IMG.base"
+_use_sample_img parallels-v1.bz2
+mv -f "$TEST_IMG" "$TEST_IMG_BASE"
+dd if="$TEST_IMG_BASE" of="$TEST_IMG" bs=64 count=1 &>/dev/null
+dd if=/dev/zero of="$TEST_IMG" bs=1M count=0 seek=1 conv=notrunc &>/dev/null
+{ $QEMU_IO -c "read -P 0x11 0 64k" \
+ "json:{
+ \"file\": {\"filename\": \"$TEST_IMG\"},
+ \"backing\":{
+ \"file\":{\"filename\":\"$TEST_IMG_BASE\"},
+ \"driver\":\"parallels\"
+ }
+ }"; } 2>&1 | _filter_qemu_io | _filter_testdir
+
# success, all done
echo "*** done"
rm -f $seq.full
@@ -27,4 +27,8 @@ read 65536/65536 bytes at offset 0
== Read from a valid v2 image opened through xml with padding ==
read 65536/65536 bytes at offset 0
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+== Read from an image with a backing image ==
+read 65536/65536 bytes at offset 0
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
*** done