111a82d14SPhilippe Mathieu-Daudé#!/usr/bin/env bash 29dd003a9SVladimir Sementsov-Ogievskiy# group: rw backing auto quick 3939e1640SKevin Wolf# 4939e1640SKevin Wolf# Rebasing COW images 5939e1640SKevin Wolf# 6939e1640SKevin Wolf# Copyright (C) 2009 Red Hat, Inc. 7939e1640SKevin Wolf# 8939e1640SKevin Wolf# This program is free software; you can redistribute it and/or modify 9939e1640SKevin Wolf# it under the terms of the GNU General Public License as published by 10939e1640SKevin Wolf# the Free Software Foundation; either version 2 of the License, or 11939e1640SKevin Wolf# (at your option) any later version. 12939e1640SKevin Wolf# 13939e1640SKevin Wolf# This program is distributed in the hope that it will be useful, 14939e1640SKevin Wolf# but WITHOUT ANY WARRANTY; without even the implied warranty of 15939e1640SKevin Wolf# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16939e1640SKevin Wolf# GNU General Public License for more details. 17939e1640SKevin Wolf# 18939e1640SKevin Wolf# You should have received a copy of the GNU General Public License 19939e1640SKevin Wolf# along with this program. If not, see <http://www.gnu.org/licenses/>. 20939e1640SKevin Wolf# 21939e1640SKevin Wolf 22939e1640SKevin Wolf# creator 23939e1640SKevin Wolfowner=kwolf@redhat.com 24939e1640SKevin Wolf 25939e1640SKevin Wolfseq=`basename $0` 26939e1640SKevin Wolfecho "QA output created by $seq" 27939e1640SKevin Wolf 28939e1640SKevin Wolfstatus=1 # failure is the default! 29939e1640SKevin Wolf 30939e1640SKevin Wolf_cleanup() 31939e1640SKevin Wolf{ 32939e1640SKevin Wolf _cleanup_test_img 33f91ecbd7SMax Reitz _rm_test_img "$TEST_DIR/t.$IMGFMT.base_old" 34f91ecbd7SMax Reitz _rm_test_img "$TEST_DIR/t.$IMGFMT.base_new" 3528036a7fSMax Reitz 36f91ecbd7SMax Reitz _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT" 37f91ecbd7SMax Reitz _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT.base_old" 38f91ecbd7SMax Reitz _rm_test_img "$TEST_DIR/subdir/t.$IMGFMT.base_new" 3928036a7fSMax Reitz rmdir "$TEST_DIR/subdir" 2> /dev/null 40939e1640SKevin Wolf} 41939e1640SKevin Wolftrap "_cleanup; exit \$status" 0 1 2 3 15 42939e1640SKevin Wolf 43939e1640SKevin Wolf# get standard environment, filters and checks 44939e1640SKevin Wolf. ./common.rc 45939e1640SKevin Wolf. ./common.filter 46939e1640SKevin Wolf. ./common.pattern 47939e1640SKevin Wolf 48f5a4bbd9SStefan Hajnoczi# Currently only qcow2 and qed support rebasing 49f5a4bbd9SStefan Hajnoczi_supported_fmt qcow2 qed 501f7bf7d0SPeter Lieven_supported_proto file 51939e1640SKevin Wolf_supported_os Linux 52939e1640SKevin Wolf 53939e1640SKevin WolfCLUSTER_SIZE=65536 54939e1640SKevin Wolf 55939e1640SKevin Wolf# Cluster allocations to be tested: 56939e1640SKevin Wolf# 57939e1640SKevin Wolf# Backing (old) 11 -- 11 -- 11 -- 11 -- 58939e1640SKevin Wolf# Backing (new) 22 22 -- -- 22 22 -- -- 59939e1640SKevin Wolf# COW image 33 33 33 33 -- -- -- -- 60d586bc63SKevin Wolf# 61d586bc63SKevin Wolf# The pattern is written twice to have both an alloc -> non-alloc and a 62d586bc63SKevin Wolf# non-alloc -> alloc transition in the COW image. 63939e1640SKevin Wolf 64939e1640SKevin Wolfecho "Creating backing file" 65939e1640SKevin Wolfecho 66939e1640SKevin Wolf 67f19f1189SFam ZhengTEST_IMG_SAVE="$TEST_IMG" 68f19f1189SFam ZhengTEST_IMG="$TEST_IMG.base_old" 69f19f1189SFam Zheng 70939e1640SKevin Wolf_make_test_img 1G 71dd0c35d6SStefan Hajnocziio_pattern writev 0 $CLUSTER_SIZE $((2 * CLUSTER_SIZE)) 8 0x11 72f19f1189SFam Zheng 73f19f1189SFam ZhengTEST_IMG="$TEST_IMG_SAVE.base_new" 74939e1640SKevin Wolf 75939e1640SKevin Wolfecho "Creating new backing file" 76939e1640SKevin Wolfecho 77939e1640SKevin Wolf 78939e1640SKevin Wolf_make_test_img 1G 79dd0c35d6SStefan Hajnocziio_pattern writev 0 $((2 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 4 0x22 80f19f1189SFam Zheng 81f19f1189SFam Zheng 82f19f1189SFam ZhengTEST_IMG="$TEST_IMG_SAVE" 83939e1640SKevin Wolf 84939e1640SKevin Wolfecho "Creating COW image" 85939e1640SKevin Wolfecho 86939e1640SKevin Wolf 87b66ff2c2SEric Blake_make_test_img -b "$TEST_IMG.base_old" -F $IMGFMT 1G 88939e1640SKevin Wolfio_pattern writev 0 $((4 * CLUSTER_SIZE)) 0 1 0x33 89d586bc63SKevin Wolfio_pattern writev $((8 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 0 1 0x33 90939e1640SKevin Wolf 91939e1640SKevin Wolfecho "Read before the rebase to make sure everything is set up correctly" 92939e1640SKevin Wolfecho 93939e1640SKevin Wolfio_pattern readv $((0 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 94939e1640SKevin Wolfio_pattern readv $((1 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 95939e1640SKevin Wolfio_pattern readv $((2 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 96939e1640SKevin Wolfio_pattern readv $((3 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 97939e1640SKevin Wolfio_pattern readv $((4 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 98939e1640SKevin Wolfio_pattern readv $((5 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 99939e1640SKevin Wolfio_pattern readv $((6 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 100939e1640SKevin Wolfio_pattern readv $((7 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 101d586bc63SKevin Wolfio_pattern readv $((8 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 102d586bc63SKevin Wolfio_pattern readv $((9 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 103d586bc63SKevin Wolfio_pattern readv $((10 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 104d586bc63SKevin Wolfio_pattern readv $((11 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 105d586bc63SKevin Wolfio_pattern readv $((12 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 106d586bc63SKevin Wolfio_pattern readv $((13 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 107d586bc63SKevin Wolfio_pattern readv $((14 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 108d586bc63SKevin Wolfio_pattern readv $((15 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 109939e1640SKevin Wolf 110939e1640SKevin Wolfecho 111939e1640SKevin Wolfecho Rebase and test again 112939e1640SKevin Wolfecho 113b66ff2c2SEric Blake$QEMU_IMG rebase -b "$TEST_IMG.base_new" -F $IMGFMT "$TEST_IMG" 114939e1640SKevin Wolfio_pattern readv $((0 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 115939e1640SKevin Wolfio_pattern readv $((1 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 116939e1640SKevin Wolfio_pattern readv $((2 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 117939e1640SKevin Wolfio_pattern readv $((3 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 118939e1640SKevin Wolfio_pattern readv $((4 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 119939e1640SKevin Wolfio_pattern readv $((5 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 120939e1640SKevin Wolfio_pattern readv $((6 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 121939e1640SKevin Wolfio_pattern readv $((7 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 122d586bc63SKevin Wolfio_pattern readv $((8 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 123d586bc63SKevin Wolfio_pattern readv $((9 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 124d586bc63SKevin Wolfio_pattern readv $((10 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 125d586bc63SKevin Wolfio_pattern readv $((11 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33 126d586bc63SKevin Wolfio_pattern readv $((12 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 127d586bc63SKevin Wolfio_pattern readv $((13 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 128d586bc63SKevin Wolfio_pattern readv $((14 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x11 129d586bc63SKevin Wolfio_pattern readv $((15 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00 130939e1640SKevin Wolf 13128036a7fSMax Reitzecho 13228036a7fSMax Reitzecho "=== Test rebase in a subdirectory of the working directory ===" 13328036a7fSMax Reitzecho 13428036a7fSMax Reitz 13528036a7fSMax Reitz# Clean up the old images beforehand so they do not interfere with 13628036a7fSMax Reitz# this test 13728036a7fSMax Reitz_cleanup 13828036a7fSMax Reitz 13928036a7fSMax Reitzmkdir "$TEST_DIR/subdir" 14028036a7fSMax Reitz 14128036a7fSMax Reitz# Relative to the overlay 14228036a7fSMax ReitzBASE_OLD_OREL="t.$IMGFMT.base_old" 14328036a7fSMax ReitzBASE_NEW_OREL="t.$IMGFMT.base_new" 14428036a7fSMax Reitz 14528036a7fSMax Reitz# Relative to $TEST_DIR (which is going to be our working directory) 14628036a7fSMax ReitzOVERLAY_WREL="subdir/t.$IMGFMT" 14728036a7fSMax Reitz 14828036a7fSMax ReitzBASE_OLD="$TEST_DIR/subdir/$BASE_OLD_OREL" 14928036a7fSMax ReitzBASE_NEW="$TEST_DIR/subdir/$BASE_NEW_OREL" 15028036a7fSMax ReitzOVERLAY="$TEST_DIR/$OVERLAY_WREL" 15128036a7fSMax Reitz 15228036a7fSMax Reitz# Test done here: 15328036a7fSMax Reitz# 15428036a7fSMax Reitz# Backing (old): 11 11 -- 11 15528036a7fSMax Reitz# Backing (new): -- 22 22 11 15628036a7fSMax Reitz# Overlay: -- -- -- -- 15728036a7fSMax Reitz# 15828036a7fSMax Reitz# Rebasing works, we have verified that above. Here, we just want to 15928036a7fSMax Reitz# see that rebasing is done for the correct target backing file. 16028036a7fSMax Reitz 16128036a7fSMax ReitzTEST_IMG=$BASE_OLD _make_test_img 1M 16228036a7fSMax ReitzTEST_IMG=$BASE_NEW _make_test_img 1M 163b66ff2c2SEric BlakeTEST_IMG=$OVERLAY _make_test_img -b "$BASE_OLD_OREL" -F $IMGFMT 1M 16428036a7fSMax Reitz 16528036a7fSMax Reitzecho 16628036a7fSMax Reitz 16728036a7fSMax Reitz$QEMU_IO "$BASE_OLD" \ 16828036a7fSMax Reitz -c "write -P 0x11 $((0 * CLUSTER_SIZE)) $((2 * CLUSTER_SIZE))" \ 16928036a7fSMax Reitz -c "write -P 0x11 $((3 * CLUSTER_SIZE)) $((1 * CLUSTER_SIZE))" \ 17028036a7fSMax Reitz | _filter_qemu_io 17128036a7fSMax Reitz 17228036a7fSMax Reitz$QEMU_IO "$BASE_NEW" \ 17328036a7fSMax Reitz -c "write -P 0x22 $((1 * CLUSTER_SIZE)) $((2 * CLUSTER_SIZE))" \ 17428036a7fSMax Reitz -c "write -P 0x11 $((3 * CLUSTER_SIZE)) $((1 * CLUSTER_SIZE))" \ 17528036a7fSMax Reitz | _filter_qemu_io 17628036a7fSMax Reitz 17728036a7fSMax Reitzecho 17828036a7fSMax Reitz 17928036a7fSMax Reitzpushd "$TEST_DIR" >/dev/null 180b66ff2c2SEric Blake$QEMU_IMG rebase -f "$IMGFMT" -b "$BASE_NEW_OREL" -F $IMGFMT "$OVERLAY_WREL" 18128036a7fSMax Reitzpopd >/dev/null 18228036a7fSMax Reitz 18328036a7fSMax Reitz# Verify the backing path is correct 184b66ff2c2SEric BlakeTEST_IMG=$OVERLAY _img_info | grep '^backing file:' 18528036a7fSMax Reitz 18628036a7fSMax Reitzecho 18728036a7fSMax Reitz 18828036a7fSMax Reitz# Verify the data is correct 18928036a7fSMax Reitz$QEMU_IO "$OVERLAY" \ 19028036a7fSMax Reitz -c "read -P 0x11 $((0 * CLUSTER_SIZE)) $CLUSTER_SIZE" \ 19128036a7fSMax Reitz -c "read -P 0x11 $((1 * CLUSTER_SIZE)) $CLUSTER_SIZE" \ 19228036a7fSMax Reitz -c "read -P 0x00 $((2 * CLUSTER_SIZE)) $CLUSTER_SIZE" \ 19328036a7fSMax Reitz -c "read -P 0x11 $((3 * CLUSTER_SIZE)) $CLUSTER_SIZE" \ 19428036a7fSMax Reitz | _filter_qemu_io 19528036a7fSMax Reitz 19628036a7fSMax Reitzecho 19728036a7fSMax Reitz 19828036a7fSMax Reitz# Verify that cluster #3 is not allocated (because it is the same in 19928036a7fSMax Reitz# $BASE_OLD and $BASE_NEW) 20028036a7fSMax Reitz$QEMU_IMG map "$OVERLAY" | _filter_qemu_img_map 20128036a7fSMax Reitz 202827171c3SAndrey Drobyshev# Check that rebase within the chain is working when 203827171c3SAndrey Drobyshev# overlay_size > old_backing_size 204827171c3SAndrey Drobyshev# 205827171c3SAndrey Drobyshev# base_new <-- base_old <-- overlay 206827171c3SAndrey Drobyshev# 207827171c3SAndrey Drobyshev# Backing (new): 11 11 11 11 11 208827171c3SAndrey Drobyshev# Backing (old): 22 22 22 22 209827171c3SAndrey Drobyshev# Overlay: -- -- -- -- -- 210827171c3SAndrey Drobyshev# 211827171c3SAndrey Drobyshev# As a result, overlay should contain data identical to base_old, with the 212827171c3SAndrey Drobyshev# last cluster remaining unallocated. 213827171c3SAndrey Drobyshev 214827171c3SAndrey Drobyshevecho 215827171c3SAndrey Drobyshevecho "=== Test rebase within one backing chain ===" 216827171c3SAndrey Drobyshevecho 217827171c3SAndrey Drobyshev 218827171c3SAndrey Drobyshevecho "Creating backing chain" 219827171c3SAndrey Drobyshevecho 220827171c3SAndrey Drobyshev 221827171c3SAndrey DrobyshevTEST_IMG=$BASE_NEW _make_test_img $(( CLUSTER_SIZE * 5 )) 222827171c3SAndrey DrobyshevTEST_IMG=$BASE_OLD _make_test_img -b "$BASE_NEW" -F $IMGFMT \ 223827171c3SAndrey Drobyshev $(( CLUSTER_SIZE * 4 )) 224827171c3SAndrey DrobyshevTEST_IMG=$OVERLAY _make_test_img -b "$BASE_OLD" -F $IMGFMT \ 225827171c3SAndrey Drobyshev $(( CLUSTER_SIZE * 5 )) 226827171c3SAndrey Drobyshev 227827171c3SAndrey Drobyshevecho 228827171c3SAndrey Drobyshevecho "Fill backing files with data" 229827171c3SAndrey Drobyshevecho 230827171c3SAndrey Drobyshev 231827171c3SAndrey Drobyshev$QEMU_IO "$BASE_NEW" -c "write -P 0x11 0 $(( CLUSTER_SIZE * 5 ))" \ 232827171c3SAndrey Drobyshev | _filter_qemu_io 233827171c3SAndrey Drobyshev$QEMU_IO "$BASE_OLD" -c "write -P 0x22 0 $(( CLUSTER_SIZE * 4 ))" \ 234827171c3SAndrey Drobyshev | _filter_qemu_io 235827171c3SAndrey Drobyshev 236827171c3SAndrey Drobyshevecho 237827171c3SAndrey Drobyshevecho "Check the last cluster is zeroed in overlay before the rebase" 238827171c3SAndrey Drobyshevecho 239827171c3SAndrey Drobyshev$QEMU_IO "$OVERLAY" -c "read -P 0x00 $(( CLUSTER_SIZE * 4 )) $CLUSTER_SIZE" \ 240827171c3SAndrey Drobyshev | _filter_qemu_io 241827171c3SAndrey Drobyshev 242827171c3SAndrey Drobyshevecho 243827171c3SAndrey Drobyshevecho "Rebase onto another image in the same chain" 244827171c3SAndrey Drobyshevecho 245827171c3SAndrey Drobyshev 246827171c3SAndrey Drobyshev$QEMU_IMG rebase -b "$BASE_NEW" -F $IMGFMT "$OVERLAY" 247827171c3SAndrey Drobyshev 248827171c3SAndrey Drobyshevecho "Verify that data is read the same before and after rebase" 249827171c3SAndrey Drobyshevecho 250827171c3SAndrey Drobyshev 251827171c3SAndrey Drobyshev# Verify the first 4 clusters are still read the same as in the old base 252827171c3SAndrey Drobyshev$QEMU_IO "$OVERLAY" -c "read -P 0x22 0 $(( CLUSTER_SIZE * 4 ))" \ 253827171c3SAndrey Drobyshev | _filter_qemu_io 254827171c3SAndrey Drobyshev# Verify the last cluster still reads as zeroes 255827171c3SAndrey Drobyshev$QEMU_IO "$OVERLAY" -c "read -P 0x00 $(( CLUSTER_SIZE * 4 )) $CLUSTER_SIZE" \ 256827171c3SAndrey Drobyshev | _filter_qemu_io 257827171c3SAndrey Drobyshev 258827171c3SAndrey Drobyshevecho 259939e1640SKevin Wolf 260f93e65eeSAndrey Drobyshev# Check that rebase within the chain is working when 261f93e65eeSAndrey Drobyshev# overlay cluster size > backings cluster size 262f93e65eeSAndrey Drobyshev# (here overlay cluster size == 2 * backings cluster size) 263f93e65eeSAndrey Drobyshev# 264f93e65eeSAndrey Drobyshev# base_new <-- base_old <-- overlay 265f93e65eeSAndrey Drobyshev# 266f93e65eeSAndrey Drobyshev# Backing (new): -- -- -- -- -- -- 267f93e65eeSAndrey Drobyshev# Backing (old): -- 11 -- -- 22 -- 268f93e65eeSAndrey Drobyshev# Overlay: |-- --|-- --|-- --| 269f93e65eeSAndrey Drobyshev# 270f93e65eeSAndrey Drobyshev# We should end up having 1st and 3rd cluster allocated, and their halves 271f93e65eeSAndrey Drobyshev# being read as zeroes. 272f93e65eeSAndrey Drobyshev 273f93e65eeSAndrey Drobyshevecho 274f93e65eeSAndrey Drobyshevecho "=== Test rebase with different cluster sizes ===" 275f93e65eeSAndrey Drobyshevecho 276f93e65eeSAndrey Drobyshev 277f93e65eeSAndrey Drobyshevecho "Creating backing chain" 278f93e65eeSAndrey Drobyshevecho 279f93e65eeSAndrey Drobyshev 280f93e65eeSAndrey DrobyshevTEST_IMG=$BASE_NEW _make_test_img $(( CLUSTER_SIZE * 6 )) 281f93e65eeSAndrey DrobyshevTEST_IMG=$BASE_OLD _make_test_img -b "$BASE_NEW" -F $IMGFMT \ 282f93e65eeSAndrey Drobyshev $(( CLUSTER_SIZE * 6 )) 283f93e65eeSAndrey DrobyshevCLUSTER_SIZE=$(( CLUSTER_SIZE * 2 )) TEST_IMG=$OVERLAY \ 284f93e65eeSAndrey Drobyshev _make_test_img -b "$BASE_OLD" -F $IMGFMT $(( CLUSTER_SIZE * 6 )) 285f93e65eeSAndrey Drobyshev 286*ca1dcc91SAndrey DrobyshevTEST_IMG=$OVERLAY _img_info | grep -v '^backing file format:' 287f93e65eeSAndrey Drobyshev 288f93e65eeSAndrey Drobyshevecho 289f93e65eeSAndrey Drobyshevecho "Fill backing files with data" 290f93e65eeSAndrey Drobyshevecho 291f93e65eeSAndrey Drobyshev 292f93e65eeSAndrey Drobyshev$QEMU_IO "$BASE_OLD" -c "write -P 0x11 $CLUSTER_SIZE $CLUSTER_SIZE" \ 293f93e65eeSAndrey Drobyshev -c "write -P 0x22 $(( CLUSTER_SIZE * 4 )) $CLUSTER_SIZE" \ 294f93e65eeSAndrey Drobyshev | _filter_qemu_io 295f93e65eeSAndrey Drobyshev 296f93e65eeSAndrey Drobyshevecho 297f93e65eeSAndrey Drobyshevecho "Rebase onto another image in the same chain" 298f93e65eeSAndrey Drobyshevecho 299f93e65eeSAndrey Drobyshev 300f93e65eeSAndrey Drobyshev$QEMU_IMG rebase -b "$BASE_NEW" -F $IMGFMT "$OVERLAY" 301f93e65eeSAndrey Drobyshev 302f93e65eeSAndrey Drobyshevecho "Verify that data is read the same before and after rebase" 303f93e65eeSAndrey Drobyshevecho 304f93e65eeSAndrey Drobyshev 305f93e65eeSAndrey Drobyshev$QEMU_IO "$OVERLAY" -c "read -P 0x00 0 $CLUSTER_SIZE" \ 306f93e65eeSAndrey Drobyshev -c "read -P 0x11 $CLUSTER_SIZE $CLUSTER_SIZE" \ 307f93e65eeSAndrey Drobyshev -c "read -P 0x00 $(( CLUSTER_SIZE * 2 )) $(( CLUSTER_SIZE * 2 ))" \ 308f93e65eeSAndrey Drobyshev -c "read -P 0x22 $(( CLUSTER_SIZE * 4 )) $CLUSTER_SIZE" \ 309f93e65eeSAndrey Drobyshev -c "read -P 0x00 $(( CLUSTER_SIZE * 5 )) $CLUSTER_SIZE" \ 310f93e65eeSAndrey Drobyshev | _filter_qemu_io 311f93e65eeSAndrey Drobyshev 312f93e65eeSAndrey Drobyshevecho 313f93e65eeSAndrey Drobyshevecho "Verify that untouched cluster remains unallocated" 314f93e65eeSAndrey Drobyshevecho 315f93e65eeSAndrey Drobyshev 316f93e65eeSAndrey Drobyshev$QEMU_IMG map "$OVERLAY" | _filter_qemu_img_map 317f93e65eeSAndrey Drobyshev 318f93e65eeSAndrey Drobyshevecho 319f93e65eeSAndrey Drobyshev 320939e1640SKevin Wolf# success, all done 321939e1640SKevin Wolfecho "*** done" 322939e1640SKevin Wolfrm -f $seq.full 323939e1640SKevin Wolfstatus=0 324