Lines Matching full:1

30 status=1	# failure is the default!
36 rm -f "$TEST_DIR"/sn{0,1,2}{,-pre,-extra,-post}
38 trap "_cleanup; exit \$status" 0 1 2 3 15
48 # (1) We create a v2 image that supports nothing but refcount_bits=16
52 _unsupported_imgopts 'refcount_bits=\([^1]\|.\([^6]\|$\)\)' data_file
55 # $1: image filename
59 id_len=$(peek_file_be "$1" $(($2 + 12)) 2)
60 name_len=$(peek_file_be "$1" $(($2 + 14)) 2)
61 extra_len=$(peek_file_be "$1" $(($2 + 36)) 4)
68 # $1: image filename
71 nb_entries=$(peek_file_be "$1" 60 4)
72 offset=$(peek_file_be "$1" 64 8)
74 echo "Snapshots in $1:" | _filter_testdir | _filter_imgfmt
77 id_len=$(peek_file_be "$1" $((offset + 12)) 2)
78 name_len=$(peek_file_be "$1" $((offset + 14)) 2)
79 extra_len=$(peek_file_be "$1" $((offset + 36)) 4)
86 echo " ID: $(peek_file_raw "$1" $id_ofs $id_len)"
87 echo " Name: $(peek_file_raw "$1" $name_ofs $name_len)"
90 echo " VM state size: $(peek_file_be "$1" $extra_ofs 8)"
93 echo " Disk size: $(peek_file_be "$1" $((extra_ofs + 8)) 8)"
96 echo " Icount: $(peek_file_be "$1" $((extra_ofs + 16)) 8)"
100 "$(peek_file_raw "$1" $((extra_ofs + 16)) $((extra_len - 16)) \
104 offset=$((offset + $(snapshot_table_entry_size "$1" $offset)))
111 # $1: Start offset of what to allocate
118 cluster=$(($1 / 65536))
124 exit 1
127 cluster=$((cluster + 1))
138 # [1]: Has extra data unknown to qemu
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 \
327 # Fill a snapshot with 1 kB of extra data, a 65535-char ID, and a
343 # 1 kB of extra data
349 # Hook up snapshot table somewhere safe (at 1 MB)
356 dd if="$TEST_DIR/sn0" of="$TEST_IMG" bs=1 seek=$offset conv=notrunc \
360 sn_count=$((sn_count + 1))
366 # (Put it two clusters before 1 MB, and one L2 table one cluster
367 # before 1 MB)
383 "$(printf '%08x' $sn_count | sed -e 's/\(..\)/\\x\1/g')"
395 echo "$((sn_count - 1)) snapshots should remain:"
412 # decreasing to 1 kB, the penultimate snapshot will fit into 64 MB
424 # truncated to 1 kB), so we drop the last three snapshots and
434 # (The -1024 comes from the 1 kB of extra data we already have)
438 "$(printf '%08x' $extra_data_size | sed -e 's/\(..\)/\\x\1/g')"
442 sn_count=$((sn_count + 1))
446 dd if="$TEST_DIR/sn0" of="$TEST_IMG" bs=1 seek=$offset conv=notrunc \
450 sn_count=$((sn_count + 1))
464 "$(printf '%08x' $sn_count | sed -e 's/\(..\)/\\x\1/g')"
484 # Hook up snapshot table somewhere safe (at 1 MB)
496 # (Put it two clusters before 1 MB, and one L2 table one cluster
497 # before 1 MB)