Lines Matching +full:0 +full:- +full:64
25 seq="$(basename $0)"
34 trap "_cleanup; exit \$status" 0 1 2 3 15
40 # This tests qcow2-specific low-level functionality
51 $QEMU_IMG info "$TEST_IMG" | sed -n '/refcount bits:/ s/^ *//p'
58 # Must be positive (non-zero)
59 _make_test_img -o "refcount_bits=0" 64M
60 # Must be positive (non-negative)
61 _make_test_img -o "refcount_bits=-1" 64M
62 # May not exceed 64
63 _make_test_img -o "refcount_bits=128" 64M
65 _make_test_img -o "refcount_bits=42" 64M
68 _make_test_img -o "refcount_bits=1" 64M
71 # 64 is the maximum
72 _make_test_img -o "refcount_bits=64" 64M
76 _make_test_img 64M
84 _make_test_img -o "compat=0.10,refcount_bits=16" 64M
88 _make_test_img -o "compat=0.10,refcount_bits=1" 64M
89 _make_test_img -o "compat=0.10,refcount_bits=64" 64M
96 _make_test_img -o "refcount_bits=1" 64M
99 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io
103 $QEMU_IMG snapshot -c foo "$TEST_IMG"
112 _make_test_img -o "refcount_bits=2" 64M
115 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io
118 $QEMU_IMG snapshot -c foo "$TEST_IMG"
119 $QEMU_IMG snapshot -c bar "$TEST_IMG"
121 $QEMU_IMG snapshot -c baz "$TEST_IMG"
130 _make_test_img -o "refcount_bits=1" 64M
136 $QEMU_IO -c 'write -P 0 -c 0 64k' \
137 -c 'write -P 1 -c 64k 64k' \
143 echo '=== MSb set in 64 bit refcount ==='
146 _make_test_img -o "refcount_bits=64" 64M
149 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io
152 poke_file "$TEST_IMG" $((0x20028)) "\x80\x00\x00\x00\x00\x00\x00\x00"
155 poke_file "$TEST_IMG" $((0x40000)) "\x00\x00\x00\x00\x00\x05\x00\x00"
158 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io
161 echo '=== Snapshot on maximum 64 bit refcount value ==='
164 _make_test_img -o "refcount_bits=64" 64M
167 $QEMU_IO -c 'write 0 512' "$TEST_IMG" | _filter_qemu_io
170 poke_file "$TEST_IMG" $((0x20028)) "\xff\xff\xff\xff\xff\xff\xff\xff"
173 poke_file "$TEST_IMG" $((0x40000)) "\x00\x00\x00\x00\x00\x05\x00\x00"
177 $QEMU_IMG snapshot -c foo "$TEST_IMG"
187 _make_test_img 64M
190 $QEMU_IO -c 'write 16M 32M' "$TEST_IMG" | _filter_qemu_io
191 $QEMU_IMG amend -o refcount_bits=1 "$TEST_IMG"
196 echo '=== Amend from refcount_bits=1 to refcount_bits=64 ==='
199 $QEMU_IMG amend -o refcount_bits=64 "$TEST_IMG"
208 $QEMU_IMG amend -o compat=0.10 "$TEST_IMG"
211 $QEMU_IMG amend -o compat=0.10,refcount_bits=16 "$TEST_IMG"
216 $QEMU_IMG amend -o compat=1.1 "$TEST_IMG"
219 $QEMU_IMG amend -o refcount_bits=32,compat=0.10 "$TEST_IMG"
226 $QEMU_IMG snapshot -c foo "$TEST_IMG"
228 $QEMU_IO -c 'write 0 16M' "$TEST_IMG" | _filter_qemu_io
232 $QEMU_IMG amend -o refcount_bits=1 "$TEST_IMG"
237 $QEMU_IMG amend -o refcount_bits=2 "$TEST_IMG"
245 _make_test_img -o "refcount_bits=1" 64M
248 # This cluster should be created at 0x50000
249 $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
250 # Now make the second L2 entry (the L2 table should be at 0x40000) point to that
252 poke_file "$TEST_IMG" $((0x40008)) "\x80\x00\x00\x00\x00\x05\x00\x00"
255 _check_test_img -r all
258 $QEMU_IMG amend -o refcount_bits=2 "$TEST_IMG"
262 _check_test_img -r all
268 _make_test_img -o "refcount_bits=1,cluster_size=512" 64k
270 # Cluster 0 is the image header, clusters 1 to 4 are used by the L1 table, a
273 # then 63 used clusters in the image. With a refcount width of 64, one refblock
274 # describes 64 clusters (512 bytes / 64 bits/entry = 64 entries), so this will
276 $QEMU_IO -c "write 0 $((58 * 512))" "$TEST_IMG" | _filter_qemu_io
286 $QEMU_IMG amend -o refcount_bits=64 -p "$TEST_IMG" | tr '\r' '\n' \
287 | grep -A 1 '66.67'
295 rm -f $seq.full
296 status=0