Lines Matching full:v2
48 # (1) We create a v2 image that supports nothing but refcount_bits=16
133 echo '=== Create v2 template ==='
136 # Create v2 image with a snapshot table with three entries:
137 # [0]: No extra data (valid with v2, not valid with v3)
140 # valid with v2, not valid with v3)
142 TEST_IMG="$TEST_IMG.v2.orig" IMGOPTS='compat=0.10' _make_test_img 64M
143 $QEMU_IMG snapshot -c sn0 "$TEST_IMG.v2.orig"
144 $QEMU_IMG snapshot -c sn1 "$TEST_IMG.v2.orig"
145 $QEMU_IMG snapshot -c sn2 "$TEST_IMG.v2.orig"
148 sn_table_ofs=$(peek_file_be "$TEST_IMG.v2.orig" 64 8)
155 sn0_eds=$(peek_file_be "$TEST_IMG.v2.orig" $((sn0_ofs + 36)) 4)
156 sn0_ids=$(($(peek_file_be "$TEST_IMG.v2.orig" $((sn0_ofs + 12)) 2) +
157 $(peek_file_be "$TEST_IMG.v2.orig" $((sn0_ofs + 14)) 2)))
158 sn0_len=$(snapshot_table_entry_size "$TEST_IMG.v2.orig" $sn0_ofs)
160 sn1_eds=$(peek_file_be "$TEST_IMG.v2.orig" $((sn1_ofs + 36)) 4)
161 sn1_ids=$(($(peek_file_be "$TEST_IMG.v2.orig" $((sn1_ofs + 12)) 2) +
162 $(peek_file_be "$TEST_IMG.v2.orig" $((sn1_ofs + 14)) 2)))
163 sn1_len=$(snapshot_table_entry_size "$TEST_IMG.v2.orig" $sn1_ofs)
165 sn2_eds=$(peek_file_be "$TEST_IMG.v2.orig" $((sn2_ofs + 36)) 4)
166 sn2_ids=$(($(peek_file_be "$TEST_IMG.v2.orig" $((sn2_ofs + 12)) 2) +
167 $(peek_file_be "$TEST_IMG.v2.orig" $((sn2_ofs + 14)) 2)))
168 sn2_len=$(snapshot_table_entry_size "$TEST_IMG.v2.orig" $sn2_ofs)
171 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn0-pre" bs=1 skip=$sn0_ofs count=40 \
173 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn1-pre" bs=1 skip=$sn1_ofs count=40 \
175 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn2-pre" bs=1 skip=$sn2_ofs count=40 \
179 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn0-extra" bs=1 \
181 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn1-extra" bs=1 \
183 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn2-extra" bs=1 \
187 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn0-post" bs=1 \
190 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn1-post" bs=1 \
193 dd if="$TEST_IMG.v2.orig" of="$TEST_DIR/sn2-post" bs=1 \
224 | dd of="$TEST_IMG.v2.orig" bs=1 seek=$sn_table_ofs conv=notrunc \
228 TEST_IMG="$TEST_IMG.v2.orig" _check_test_img
229 print_snapshot_table "$TEST_IMG.v2.orig"
235 cp "$TEST_IMG.v2.orig" "$TEST_IMG.v3.orig"
244 # Force the v2 file to be v3. v3 requires each snapshot table entry
247 cp "$TEST_IMG.v2.orig" "$TEST_IMG"
261 # (v3 by default, v2 by choice through $IMGOPTS.)
265 if echo "$IMGOPTS" | grep -q 'compat=\(0\.10\|v2\)' 2> /dev/null; then
266 subver=v2
480 # Create a v2 image, for speeds' sake: All-zero snapshot table entries
481 # are only valid in v2.
490 # only in v2 (v3 needs 16 bytes of extra data, so we would have to