Lines Matching +full:- +full:- +full:-
4 # Test qemu-img rebase with compression
51 # 1. "qemu-img rebase -c" should refuse working with any format which doesn't
52 # support compression. We only check "-f raw" here.
57 $QEMU_IMG create -f raw "$TEST_IMG" "$size" | _filter_img_create
58 $QEMU_IMG rebase -c -f raw -b "" "$TEST_IMG"
60 # 2. Write the 1st half of $size to backing file (compressed), 2nd half -- to
62 # with compression (i.e. "qemu-img -c -b ''"). Check that the resulting image
63 # has the written data preserved, and "qemu-img check" reports 100% clusters
70 _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
72 $QEMU_IO -c "write -c -P 0xaa 0 $half_size" "$TEST_IMG.base" | _filter_qemu_io
73 $QEMU_IO -c "write -c -P 0xbb $half_size $half_size" "$TEST_IMG" \
76 $QEMU_IMG rebase -c -f $IMGFMT -b "" "$TEST_IMG"
78 $QEMU_IO -c "read -P 0xaa 0 $half_size" "$TEST_IMG" | _filter_qemu_io
79 $QEMU_IO -c "read -P 0xbb $half_size $half_size" "$TEST_IMG" | _filter_qemu_io
89 $QEMU_IMG create -f raw "$TEST_IMG.base" "$half_size" | _filter_img_create
90 _make_test_img -b "$TEST_IMG.base" -F raw $size
92 $QEMU_IO -f raw -c "write -P 0xaa 0 $half_size" "$TEST_IMG.base" \
94 $QEMU_IO -c "write -c -P 0xbb $half_size $half_size" \
97 $QEMU_IMG rebase -c -f $IMGFMT -b "" "$TEST_IMG"
99 $QEMU_IO -c "read -P 0xaa 0 $half_size" "$TEST_IMG" | _filter_qemu_io
100 $QEMU_IO -c "read -P 0xbb $half_size $half_size" "$TEST_IMG" | _filter_qemu_io
104 # 4. Create a backing chain base<--itmd<--img, filling 1st, 2nd and 3rd
107 # preserved in the resulting image. Also check that "qemu-img check" reports
114 TEST_IMG="$TEST_IMG.itmd" _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $size
115 _make_test_img -b "$TEST_IMG.itmd" -F $IMGFMT $size
117 $QEMU_IO -c "write -c -P 0xaa 0 $third_size" \
119 $QEMU_IO -c "write -c -P 0xbb $third_size $third_size" \
121 $QEMU_IO -c "write -c -P 0xcc $((third_size * 2 )) $third_size" \
124 $QEMU_IMG rebase -c -f $IMGFMT -b "$TEST_IMG.base" -F $IMGFMT "$TEST_IMG"
126 $QEMU_IO -c "read -P 0xaa 0 $third_size" "$TEST_IMG" | _filter_qemu_io
127 $QEMU_IO -c "read -P 0xbb $third_size $third_size" \
129 $QEMU_IO -c "read -P 0xcc $(( third_size * 2 )) $third_size" \
134 # 5. Create one-cluster backing and overlay images, and fill only the first
135 # (half - 1) bytes of the backing with data (uncompressed). Rebase the
137 # read correctly, and that cluster is now really compressed ("qemu-img check"
146 _make_test_img -b "$TEST_IMG.base" -F $IMGFMT $CLUSTER_SIZE
148 $QEMU_IO -c "write -P 0xaa 0 $(( CLUSTER_SIZE / 2 - 1 ))" $TEST_IMG.base \
151 $QEMU_IMG rebase -c -f $IMGFMT -b "" "$TEST_IMG"
153 $QEMU_IO -c "read -P 0xaa 0 $(( CLUSTER_SIZE / 2 - 1 ))" "$TEST_IMG" \
155 $QEMU_IO -c \
156 "read -P 0x00 $(( CLUSTER_SIZE / 2 - 1 )) $(( CLUSTER_SIZE / 2 + 1 ))" \
164 rm -f $seq.full