1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
|
QA output created by 271
### Standard write tests (backing file: yes) ###
Formatting 'TEST_DIR/t.IMGFMT.raw', fmt=raw size=1048576
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=raw size=1048576
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
write -q -P PATTERN 0 1k
L2 entry #0: 0x8000000000050000 0000000000000001
write -q -P PATTERN 3k 512
L2 entry #0: 0x8000000000050000 0000000000000003
write -q -P PATTERN 5k 1k
L2 entry #0: 0x8000000000050000 0000000000000007
write -q -P PATTERN 6k 2k
L2 entry #0: 0x8000000000050000 000000000000000f
write -q -P PATTERN 8k 6k
L2 entry #0: 0x8000000000050000 000000000000007f
write -q -P PATTERN 15k 4k
L2 entry #0: 0x8000000000050000 00000000000003ff
write -q -P PATTERN 32k 1k
L2 entry #0: 0x8000000000050000 00000000000103ff
write -q -P PATTERN 63k 4k
L2 entry #0: 0x8000000000050000 00000000800103ff
L2 entry #1: 0x8000000000060000 0000000000000003
write -q -z 2k 2k
L2 entry #0: 0x8000000000050000 00000002800103fd
write -q -z 0 64k
L2 entry #0: 0x8000000000050000 ffffffff00000000
write -q -P PATTERN 0 64k
L2 entry #0: 0x8000000000050000 00000000ffffffff
write -q -z -u 0 32k
L2 entry #0: 0x8000000000050000 0000ffffffff0000
write -q -z -u 0 64k
L2 entry #0: 0x0000000000000000 ffffffff00000000
write -q -P PATTERN 3k 512
L2 entry #0: 0x8000000000050000 fffffffd00000002
write -q -P PATTERN 0 64k
L2 entry #0: 0x8000000000050000 00000000ffffffff
discard -q 0 64k
L2 entry #0: 0x0000000000000000 ffffffff00000000
write -q -c -P PATTERN 0 64k
L2 entry #0: 0x4000000000050000 0000000000000000
write -q -P PATTERN 3k 512
L2 entry #0: 0x8000000000070000 00000000ffffffff
### Standard write tests (backing file: no) ###
Formatting 'TEST_DIR/t.IMGFMT.raw', fmt=raw size=1048576
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
write -q -P PATTERN 0 1k
L2 entry #0: 0x8000000000050000 0000000000000001
write -q -P PATTERN 3k 512
L2 entry #0: 0x8000000000050000 0000000000000003
write -q -P PATTERN 5k 1k
L2 entry #0: 0x8000000000050000 0000000000000007
write -q -P PATTERN 6k 2k
L2 entry #0: 0x8000000000050000 000000000000000f
write -q -P PATTERN 8k 6k
L2 entry #0: 0x8000000000050000 000000000000007f
write -q -P PATTERN 15k 4k
L2 entry #0: 0x8000000000050000 00000000000003ff
write -q -P PATTERN 32k 1k
L2 entry #0: 0x8000000000050000 00000000000103ff
write -q -P PATTERN 63k 4k
L2 entry #0: 0x8000000000050000 00000000800103ff
L2 entry #1: 0x8000000000060000 0000000000000003
write -q -z 2k 2k
L2 entry #0: 0x8000000000050000 00000002800103fd
write -q -z 0 64k
L2 entry #0: 0x8000000000050000 ffffffff00000000
write -q -P PATTERN 0 64k
L2 entry #0: 0x8000000000050000 00000000ffffffff
write -q -z -u 0 32k
L2 entry #0: 0x8000000000050000 0000ffffffff0000
write -q -z -u 0 64k
L2 entry #0: 0x0000000000000000 ffffffff00000000
write -q -P PATTERN 3k 512
L2 entry #0: 0x8000000000050000 fffffffd00000002
write -q -P PATTERN 0 64k
L2 entry #0: 0x8000000000050000 00000000ffffffff
discard -q 0 64k
L2 entry #0: 0x0000000000000000 ffffffff00000000
write -q -c -P PATTERN 0 64k
L2 entry #0: 0x4000000000050000 0000000000000000
write -q -P PATTERN 3k 512
L2 entry #0: 0x8000000000070000 00000000ffffffff
### Overwriting several clusters without COW ###
Formatting 'TEST_DIR/t.IMGFMT.raw', fmt=raw size=1048576
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
write -q -P PATTERN 24k 40k
L2 entry #0: 0x8000000000050000 00000000fffff000
write -q -P PATTERN 90k 2k
L2 entry #1: 0x8000000000060000 0000000000002000
write -q -P PATTERN 156k 2k
L2 entry #2: 0x8000000000070000 0000000000004000
write -q -z 156k 2k
L2 entry #2: 0x8000000000070000 0000400000000000
write -q -P PATTERN 192k 34k
L2 entry #3: 0x8000000000080000 000000000001ffff
write -q -P PATTERN 24k 192k
L2 entry #0: 0x8000000000050000 00000000fffff000
L2 entry #1: 0x8000000000060000 00000000ffffffff
L2 entry #2: 0x8000000000070000 00000000ffffffff
L2 entry #3: 0x8000000000080000 000000000001ffff
### Writing zeroes 1: unallocated clusters (backing file: yes) ###
Formatting 'TEST_DIR/t.IMGFMT.raw', fmt=raw size=2132992
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=raw size=2132992
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2132992 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
write -q -z 0 192k
L2 entry #0: 0x0000000000000000 ffffffff00000000
L2 entry #1: 0x0000000000000000 ffffffff00000000
L2 entry #2: 0x0000000000000000 ffffffff00000000
write -q -z 224k 128k
L2 entry #3: 0x0000000000000000 ffff000000000000
L2 entry #4: 0x0000000000000000 ffffffff00000000
L2 entry #5: 0x0000000000000000 0000ffff00000000
write -q -z 415k 128k
L2 entry #6: 0x8000000000050000 ffff000000008000
L2 entry #7: 0x0000000000000000 ffffffff00000000
L2 entry #8: 0x8000000000060000 00007fff00008000
### Writing zeroes 2: allocated clusters (backing file: yes) ###
write -q -P PATTERN 576k 576k
L2 entry #9: 0x8000000000070000 00000000ffffffff
L2 entry #10: 0x8000000000080000 00000000ffffffff
L2 entry #11: 0x8000000000090000 00000000ffffffff
L2 entry #12: 0x80000000000a0000 00000000ffffffff
L2 entry #13: 0x80000000000b0000 00000000ffffffff
L2 entry #14: 0x80000000000c0000 00000000ffffffff
L2 entry #15: 0x80000000000d0000 00000000ffffffff
L2 entry #16: 0x80000000000e0000 00000000ffffffff
L2 entry #17: 0x80000000000f0000 00000000ffffffff
write -q -z 576k 192k
L2 entry #9: 0x8000000000070000 ffffffff00000000
L2 entry #10: 0x8000000000080000 ffffffff00000000
L2 entry #11: 0x8000000000090000 ffffffff00000000
write -q -z 800k 128k
L2 entry #12: 0x80000000000a0000 ffff00000000ffff
L2 entry #13: 0x80000000000b0000 ffffffff00000000
L2 entry #14: 0x80000000000c0000 0000ffffffff0000
write -q -z 991k 128k
L2 entry #15: 0x80000000000d0000 ffff00000000ffff
L2 entry #16: 0x80000000000e0000 ffffffff00000000
L2 entry #17: 0x80000000000f0000 00007fffffff8000
### Writing zeroes 3: compressed clusters (backing file: yes) ###
write -q -c -P PATTERN 1152k 64k
L2 entry #18: 0x4000000000100000 0000000000000000
write -q -c -P PATTERN 1216k 64k
L2 entry #19: 0x4000000000110000 0000000000000000
write -q -c -P PATTERN 1280k 64k
L2 entry #20: 0x4000000000120000 0000000000000000
write -q -c -P PATTERN 1344k 64k
L2 entry #21: 0x4000000000130000 0000000000000000
write -q -c -P PATTERN 1408k 64k
L2 entry #22: 0x4000000000140000 0000000000000000
write -q -c -P PATTERN 1472k 64k
L2 entry #23: 0x4000000000150000 0000000000000000
write -q -c -P PATTERN 1536k 64k
L2 entry #24: 0x4000000000160000 0000000000000000
write -q -c -P PATTERN 1600k 64k
L2 entry #25: 0x4000000000170000 0000000000000000
write -q -c -P PATTERN 1664k 64k
L2 entry #26: 0x4000000000180000 0000000000000000
write -q -c -P PATTERN 1728k 64k
L2 entry #27: 0x4000000000190000 0000000000000000
write -q -c -P PATTERN 1792k 64k
L2 entry #28: 0x40000000001a0000 0000000000000000
write -q -z 1152k 192k
L2 entry #18: 0x0000000000000000 ffffffff00000000
L2 entry #19: 0x0000000000000000 ffffffff00000000
L2 entry #20: 0x0000000000000000 ffffffff00000000
write -q -z 1376k 128k
L2 entry #21: 0x8000000000100000 00000000ffffffff
L2 entry #22: 0x8000000000110000 00000000ffffffff
L2 entry #23: 0x8000000000120000 00000000ffffffff
write -q -z 1567k 129k
L2 entry #24: 0x8000000000130000 00000000ffffffff
L2 entry #25: 0x8000000000140000 00000000ffffffff
L2 entry #26: 0x8000000000150000 00000000ffffffff
write -q -z 1759k 128k
L2 entry #27: 0x8000000000160000 ffff00000000ffff
L2 entry #28: 0x0000000000000000 ffffffff00000000
L2 entry #29: 0x8000000000170000 00007fff00008000
### Writing zeroes 4: other tests (backing file: yes) ###
write -q -z 1951k 8k
L2 entry #30: 0x8000000000180000 0007000000088000
write -q -z 2048k 35k
L2 entry #32: 0x0000000000000000 0003ffff00000000
### Writing zeroes 1: unallocated clusters (backing file: no) ###
Formatting 'TEST_DIR/t.IMGFMT.raw', fmt=raw size=2132992
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2132992
write -q -z 0 192k
L2 entry #0: 0x0000000000000000 ffffffff00000000
L2 entry #1: 0x0000000000000000 ffffffff00000000
L2 entry #2: 0x0000000000000000 ffffffff00000000
write -q -z 224k 128k
L2 entry #3: 0x0000000000000000 ffff000000000000
L2 entry #4: 0x0000000000000000 ffffffff00000000
L2 entry #5: 0x0000000000000000 0000ffff00000000
write -q -z 415k 128k
L2 entry #6: 0x0000000000000000 ffff800000000000
L2 entry #7: 0x0000000000000000 ffffffff00000000
L2 entry #8: 0x0000000000000000 0000ffff00000000
### Writing zeroes 2: allocated clusters (backing file: no) ###
write -q -P PATTERN 576k 576k
L2 entry #9: 0x8000000000050000 00000000ffffffff
L2 entry #10: 0x8000000000060000 00000000ffffffff
L2 entry #11: 0x8000000000070000 00000000ffffffff
L2 entry #12: 0x8000000000080000 00000000ffffffff
L2 entry #13: 0x8000000000090000 00000000ffffffff
L2 entry #14: 0x80000000000a0000 00000000ffffffff
L2 entry #15: 0x80000000000b0000 00000000ffffffff
L2 entry #16: 0x80000000000c0000 00000000ffffffff
L2 entry #17: 0x80000000000d0000 00000000ffffffff
write -q -z 576k 192k
L2 entry #9: 0x8000000000050000 ffffffff00000000
L2 entry #10: 0x8000000000060000 ffffffff00000000
L2 entry #11: 0x8000000000070000 ffffffff00000000
write -q -z 800k 128k
L2 entry #12: 0x8000000000080000 ffff00000000ffff
L2 entry #13: 0x8000000000090000 ffffffff00000000
L2 entry #14: 0x80000000000a0000 0000ffffffff0000
write -q -z 991k 128k
L2 entry #15: 0x80000000000b0000 ffff00000000ffff
L2 entry #16: 0x80000000000c0000 ffffffff00000000
L2 entry #17: 0x80000000000d0000 00007fffffff8000
### Writing zeroes 3: compressed clusters (backing file: no) ###
write -q -c -P PATTERN 1152k 64k
L2 entry #18: 0x40000000000e0000 0000000000000000
write -q -c -P PATTERN 1216k 64k
L2 entry #19: 0x40000000000f0000 0000000000000000
write -q -c -P PATTERN 1280k 64k
L2 entry #20: 0x4000000000100000 0000000000000000
write -q -c -P PATTERN 1344k 64k
L2 entry #21: 0x4000000000110000 0000000000000000
write -q -c -P PATTERN 1408k 64k
L2 entry #22: 0x4000000000120000 0000000000000000
write -q -c -P PATTERN 1472k 64k
L2 entry #23: 0x4000000000130000 0000000000000000
write -q -c -P PATTERN 1536k 64k
L2 entry #24: 0x4000000000140000 0000000000000000
write -q -c -P PATTERN 1600k 64k
L2 entry #25: 0x4000000000150000 0000000000000000
write -q -c -P PATTERN 1664k 64k
L2 entry #26: 0x4000000000160000 0000000000000000
write -q -c -P PATTERN 1728k 64k
L2 entry #27: 0x4000000000170000 0000000000000000
write -q -c -P PATTERN 1792k 64k
L2 entry #28: 0x4000000000180000 0000000000000000
write -q -z 1152k 192k
L2 entry #18: 0x0000000000000000 ffffffff00000000
L2 entry #19: 0x0000000000000000 ffffffff00000000
L2 entry #20: 0x0000000000000000 ffffffff00000000
write -q -z 1376k 128k
L2 entry #21: 0x80000000000e0000 00000000ffffffff
L2 entry #22: 0x80000000000f0000 00000000ffffffff
L2 entry #23: 0x8000000000100000 00000000ffffffff
write -q -z 1567k 129k
L2 entry #24: 0x8000000000110000 00000000ffffffff
L2 entry #25: 0x8000000000120000 00000000ffffffff
L2 entry #26: 0x8000000000130000 00000000ffffffff
write -q -z 1759k 128k
L2 entry #27: 0x8000000000140000 ffff00000000ffff
L2 entry #28: 0x0000000000000000 ffffffff00000000
L2 entry #29: 0x0000000000000000 0000ffff00000000
### Writing zeroes 4: other tests (backing file: no) ###
write -q -z 1951k 8k
L2 entry #30: 0x0000000000000000 000f800000000000
write -q -z 2048k 35k
L2 entry #32: 0x0000000000000000 0003ffff00000000
### Zero + unmap 1: allocated clusters (backing file: yes) ###
Formatting 'TEST_DIR/t.IMGFMT.raw', fmt=raw size=2132992
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=raw size=2132992
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2132992 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
write -q -P PATTERN 576k 576k
L2 entry #9: 0x8000000000050000 00000000ffffffff
L2 entry #10: 0x8000000000060000 00000000ffffffff
L2 entry #11: 0x8000000000070000 00000000ffffffff
L2 entry #12: 0x8000000000080000 00000000ffffffff
L2 entry #13: 0x8000000000090000 00000000ffffffff
L2 entry #14: 0x80000000000a0000 00000000ffffffff
L2 entry #15: 0x80000000000b0000 00000000ffffffff
L2 entry #16: 0x80000000000c0000 00000000ffffffff
L2 entry #17: 0x80000000000d0000 00000000ffffffff
write -q -z -u 576k 192k
L2 entry #9: 0x0000000000000000 ffffffff00000000
L2 entry #10: 0x0000000000000000 ffffffff00000000
L2 entry #11: 0x0000000000000000 ffffffff00000000
write -q -z -u 800k 128k
L2 entry #12: 0x8000000000080000 ffff00000000ffff
L2 entry #13: 0x0000000000000000 ffffffff00000000
L2 entry #14: 0x80000000000a0000 0000ffffffff0000
write -q -z -u 991k 128k
L2 entry #15: 0x80000000000b0000 ffff00000000ffff
L2 entry #16: 0x0000000000000000 ffffffff00000000
L2 entry #17: 0x80000000000d0000 00007fffffff8000
### Zero + unmap 2: compressed clusters (backing file: yes) ###
write -q -c -P PATTERN 1152k 64k
L2 entry #18: 0x4000000000050000 0000000000000000
write -q -c -P PATTERN 1216k 64k
L2 entry #19: 0x4000000000060000 0000000000000000
write -q -c -P PATTERN 1280k 64k
L2 entry #20: 0x4000000000070000 0000000000000000
write -q -c -P PATTERN 1344k 64k
L2 entry #21: 0x4000000000090000 0000000000000000
write -q -c -P PATTERN 1408k 64k
L2 entry #22: 0x40000000000c0000 0000000000000000
write -q -c -P PATTERN 1472k 64k
L2 entry #23: 0x40000000000e0000 0000000000000000
write -q -c -P PATTERN 1536k 64k
L2 entry #24: 0x40000000000f0000 0000000000000000
write -q -c -P PATTERN 1600k 64k
L2 entry #25: 0x4000000000100000 0000000000000000
write -q -c -P PATTERN 1664k 64k
L2 entry #26: 0x4000000000110000 0000000000000000
write -q -c -P PATTERN 1728k 64k
L2 entry #27: 0x4000000000120000 0000000000000000
write -q -c -P PATTERN 1792k 64k
L2 entry #28: 0x4000000000130000 0000000000000000
write -q -z -u 1152k 192k
L2 entry #18: 0x0000000000000000 ffffffff00000000
L2 entry #19: 0x0000000000000000 ffffffff00000000
L2 entry #20: 0x0000000000000000 ffffffff00000000
write -q -z -u 1376k 128k
L2 entry #21: 0x8000000000050000 00000000ffffffff
L2 entry #22: 0x8000000000060000 00000000ffffffff
L2 entry #23: 0x8000000000070000 00000000ffffffff
write -q -z -u 1567k 129k
L2 entry #24: 0x8000000000090000 00000000ffffffff
L2 entry #25: 0x80000000000e0000 00000000ffffffff
L2 entry #26: 0x80000000000f0000 00000000ffffffff
write -q -z -u 1759k 128k
L2 entry #27: 0x80000000000c0000 ffff00000000ffff
L2 entry #28: 0x0000000000000000 ffffffff00000000
L2 entry #29: 0x8000000000100000 00007fff00008000
### Zero + unmap 1: allocated clusters (backing file: no) ###
Formatting 'TEST_DIR/t.IMGFMT.raw', fmt=raw size=2132992
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2132992
write -q -P PATTERN 576k 576k
L2 entry #9: 0x8000000000050000 00000000ffffffff
L2 entry #10: 0x8000000000060000 00000000ffffffff
L2 entry #11: 0x8000000000070000 00000000ffffffff
L2 entry #12: 0x8000000000080000 00000000ffffffff
L2 entry #13: 0x8000000000090000 00000000ffffffff
L2 entry #14: 0x80000000000a0000 00000000ffffffff
L2 entry #15: 0x80000000000b0000 00000000ffffffff
L2 entry #16: 0x80000000000c0000 00000000ffffffff
L2 entry #17: 0x80000000000d0000 00000000ffffffff
write -q -z -u 576k 192k
L2 entry #9: 0x0000000000000000 ffffffff00000000
L2 entry #10: 0x0000000000000000 ffffffff00000000
L2 entry #11: 0x0000000000000000 ffffffff00000000
write -q -z -u 800k 128k
L2 entry #12: 0x8000000000080000 ffff00000000ffff
L2 entry #13: 0x0000000000000000 ffffffff00000000
L2 entry #14: 0x80000000000a0000 0000ffffffff0000
write -q -z -u 991k 128k
L2 entry #15: 0x80000000000b0000 ffff00000000ffff
L2 entry #16: 0x0000000000000000 ffffffff00000000
L2 entry #17: 0x80000000000d0000 00007fffffff8000
### Zero + unmap 2: compressed clusters (backing file: no) ###
write -q -c -P PATTERN 1152k 64k
L2 entry #18: 0x4000000000050000 0000000000000000
write -q -c -P PATTERN 1216k 64k
L2 entry #19: 0x4000000000060000 0000000000000000
write -q -c -P PATTERN 1280k 64k
L2 entry #20: 0x4000000000070000 0000000000000000
write -q -c -P PATTERN 1344k 64k
L2 entry #21: 0x4000000000090000 0000000000000000
write -q -c -P PATTERN 1408k 64k
L2 entry #22: 0x40000000000c0000 0000000000000000
write -q -c -P PATTERN 1472k 64k
L2 entry #23: 0x40000000000e0000 0000000000000000
write -q -c -P PATTERN 1536k 64k
L2 entry #24: 0x40000000000f0000 0000000000000000
write -q -c -P PATTERN 1600k 64k
L2 entry #25: 0x4000000000100000 0000000000000000
write -q -c -P PATTERN 1664k 64k
L2 entry #26: 0x4000000000110000 0000000000000000
write -q -c -P PATTERN 1728k 64k
L2 entry #27: 0x4000000000120000 0000000000000000
write -q -c -P PATTERN 1792k 64k
L2 entry #28: 0x4000000000130000 0000000000000000
write -q -z -u 1152k 192k
L2 entry #18: 0x0000000000000000 ffffffff00000000
L2 entry #19: 0x0000000000000000 ffffffff00000000
L2 entry #20: 0x0000000000000000 ffffffff00000000
write -q -z -u 1376k 128k
L2 entry #21: 0x8000000000050000 00000000ffffffff
L2 entry #22: 0x8000000000060000 00000000ffffffff
L2 entry #23: 0x8000000000070000 00000000ffffffff
write -q -z -u 1567k 129k
L2 entry #24: 0x8000000000090000 00000000ffffffff
L2 entry #25: 0x80000000000e0000 00000000ffffffff
L2 entry #26: 0x80000000000f0000 00000000ffffffff
write -q -z -u 1759k 128k
L2 entry #27: 0x80000000000c0000 ffff00000000ffff
L2 entry #28: 0x0000000000000000 ffffffff00000000
L2 entry #29: 0x0000000000000000 0000ffff00000000
### Discarding clusters with non-zero bitmaps (backing file: yes) ###
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
L2 entry #0: 0x0000000000000000 ffffffff00000000
L2 entry #1: 0x0000000000000000 ffffffff00000000
Image resized.
Image resized.
L2 entry #0: 0x0000000000000000 ffffffff00000000
L2 entry #1: 0x0000000000000000 ffffffff00000000
### Discarding clusters with non-zero bitmaps (backing file: no) ###
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x0000000000000000 ffffffff00000000
L2 entry #1: 0x0000000000000000 ffffffff00000000
Image resized.
Image resized.
L2 entry #0: 0x0000000000000000 0000ffff00000000
L2 entry #1: 0x0000000000000000 0000000000000000
### Corrupted L2 entries - read test (allocated) ###
# 'cluster is zero' bit set on the standard cluster descriptor
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x8000000000050001 0000000000000001
L2 entry #0: 0x8000000000050001 0000000000000001
# Both 'subcluster is zero' and 'subcluster is allocated' bits set
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #1: 0x8000000000060000 00000001ffffffff
qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
read failed: Input/output error
### Corrupted L2 entries - read test (unallocated) ###
# 'cluster is zero' bit set on the standard cluster descriptor
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x0000000000000001 0000000000000000
L2 entry #0: 0x0000000000000001 0000000000000000
# 'subcluster is allocated' bit set
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x0000000000000000 0000000000000001
qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
read failed: Input/output error
# Both 'subcluster is zero' and 'subcluster is allocated' bits set
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #1: 0x0000000000000000 0000000100000001
qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
read failed: Input/output error
### Compressed cluster with subcluster bitmap != 0 - read test ###
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x4000000000050000 0000000180000000
read 65536/65536 bytes at offset 0
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
L2 entry #0: 0x4000000000050000 0000000180000000
### Corrupted L2 entries - write test (allocated) ###
# 'cluster is zero' bit set on the standard cluster descriptor
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x8000000000050001 0000000000000001
L2 entry #0: 0x8000000000050001 0000000000000001
# Both 'subcluster is zero' and 'subcluster is allocated' bits set
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #1: 0x8000000000060000 00000001ffffffff
qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
write failed: Input/output error
### Corrupted L2 entries - write test (unallocated) ###
# 'cluster is zero' bit set on the standard cluster descriptor
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x0000000000000001 0000000000000000
L2 entry #0: 0x8000000000060000 0000000000000001
# 'subcluster is allocated' bit set
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x0000000000000000 0000000000000001
qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
write failed: Input/output error
# Both 'subcluster is zero' and 'subcluster is allocated' bits set
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #1: 0x0000000000000000 0000000100000001
qcow2: Marking image as corrupt: Invalid cluster entry found (L2 offset: 0x40000, L2 index: 0x1); further corruption events will be suppressed
write failed: Input/output error
### Compressed cluster with subcluster bitmap != 0 - write test ###
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x4000000000050000 0000000180000000
wrote 65536/65536 bytes at offset 0
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
L2 entry #0: 0x8000000000060000 00000000ffffffff
### Detect and repair unaligned clusters ###
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=raw size=131072
# Corrupted L2 entry, allocated subcluster #
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
ERROR offset=50200: Data cluster is not properly aligned; L2 entry corrupted.
ERROR cluster 6 refcount=0 reference=1
Rebuilding refcount structure
ERROR offset=50200: Data cluster is not properly aligned; L2 entry corrupted.
Repairing cluster 1 refcount=1 reference=0
Repairing cluster 2 refcount=1 reference=0
ERROR offset=50200: Data cluster is not properly aligned; L2 entry corrupted.
The following inconsistencies were found and repaired:
0 leaked clusters
1 corruptions
Double checking the fixed image now...
1 errors were found on the image.
Data may be corrupted, or further writes to the image may corrupt it.
qcow2: Marking image as corrupt: Cluster allocation offset 0x50200 unaligned (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
read failed: Input/output error
# Corrupted L2 entry, no allocated subclusters #
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
Repairing offset=50200: Preallocated cluster is not properly aligned; L2 entry corrupted.
Leaked cluster 5 refcount=1 reference=0
Repairing cluster 5 refcount=1 reference=0
The following inconsistencies were found and repaired:
1 leaked clusters
1 corruptions
Double checking the fixed image now...
No errors were found on the image.
### Image creation options ###
# cluster_size < 16k
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
qemu-img: TEST_DIR/t.IMGFMT: Extended L2 entries are only supported with cluster sizes of at least 16384 bytes
# backing file and preallocation=metadata
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=raw size=1048576
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=524288 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw preallocation=metadata
Image resized.
read 524288/524288 bytes at offset 0
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 524288/524288 bytes at offset 524288
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Offset Length Mapped to File
0 0x80000 0 TEST_DIR/t.qcow2.base
# backing file and preallocation=falloc
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=524288 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw preallocation=falloc
Image resized.
read 524288/524288 bytes at offset 0
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 524288/524288 bytes at offset 524288
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Offset Length Mapped to File
0 0x80000 0 TEST_DIR/t.qcow2.base
# backing file and preallocation=full
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=524288 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw preallocation=full
Image resized.
read 524288/524288 bytes at offset 0
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 524288/524288 bytes at offset 524288
512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Offset Length Mapped to File
0 0x80000 0 TEST_DIR/t.qcow2.base
### Image resizing with preallocation and backing files ###
# resize --preallocation=metadata
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=515072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
Image resized.
read 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 522240/522240 bytes at offset 515072
510 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# resize --preallocation=falloc
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=515072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
Image resized.
read 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 522240/522240 bytes at offset 515072
510 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# resize --preallocation=full
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=515072 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=raw
Image resized.
read 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 522240/522240 bytes at offset 515072
510 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
### Image resizing with preallocation without backing files ###
# resize --preallocation=metadata
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=515072
wrote 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Image resized.
read 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 522240/522240 bytes at offset 515072
510 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# resize --preallocation=falloc
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=515072
wrote 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Image resized.
read 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 522240/522240 bytes at offset 515072
510 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# resize --preallocation=full
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=515072
wrote 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Image resized.
read 515072/515072 bytes at offset 0
503 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 522240/522240 bytes at offset 515072
510 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
### qemu-img measure ###
# 512MB, extended_l2=off
required size: 327680
fully allocated size: 537198592
# 512MB, extended_l2=on
required size: 393216
fully allocated size: 537264128
# 16K clusters, 64GB, extended_l2=off
required size: 42008576
fully allocated size: 68761485312
# 16K clusters, 64GB, extended_l2=on
required size: 75579392
fully allocated size: 68795056128
# 8k clusters
qemu-img: Extended L2 entries are only supported with cluster sizes of at least 16384 bytes
# 1024 TB
required size: 309285027840
fully allocated size: 1126209191870464
# 1025 TB
qemu-img: The image size is too large (try using a larger cluster size)
### qemu-img amend ###
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
qemu-img: Invalid parameter 'extended_l2'
This option is only supported for image creation
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
qemu-img: Invalid parameter 'extended_l2'
This option is only supported for image creation
### Test copy-on-write on an image with snapshots ###
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
L2 entry #0: 0x8000000000050000 0000008000042000
L2 entry #1: 0x8000000000060000 0000008000042000
L2 entry #2: 0x8000000000070000 0000008000042000
L2 entry #3: 0x8000000000080000 0000008000042000
L2 entry #4: 0x8000000000090000 0000008000042000
L2 entry #5: 0x80000000000a0000 0000008000042000
L2 entry #6: 0x80000000000b0000 0000008000042000
L2 entry #7: 0x80000000000c0000 0000008000042000
L2 entry #8: 0x80000000000d0000 0000008000042000
L2 entry #9: 0x80000000000e0000 0000008000042000
L2 entry #0: 0x8000000000120000 000000800007e000
L2 entry #1: 0x8000000000130000 000000800007fc00
L2 entry #2: 0x8000000000140000 00000080001fe000
L2 entry #3: 0x8000000000150000 000000800007e000
L2 entry #4: 0x8000000000160000 000000000007ff80
L2 entry #5: 0x8000000000170000 000000000007ffff
L2 entry #6: 0x00000000000b0000 0001808000042000
L2 entry #7: 0x00000000000c0000 0000208000040000
L2 entry #8: 0x8000000000180000 000000800007e000
L2 entry #9: 0x00000000000e0000 000000c000042000
### Test concurrent requests ###
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576
blkdebug: Suspended request 'A'
blkdebug: Resuming request 'A'
wrote 2048/2048 bytes at offset 30720
2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 2048/2048 bytes at offset OFFSET
2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 2048/2048 bytes at offset OFFSET
2 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
### Rebase of qcow2 images with subclusters ###
### Preservation of unallocated holes after rebase ###
# create backing chain
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576
Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
Formatting 'TEST_DIR/t.IMGFMT.top', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
# fill old backing with data (separate subclusters within cluster)
wrote 32768/32768 bytes at offset 32768
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 32768/32768 bytes at offset 983040
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# rebase topmost image onto the new backing
# verify that data is read the same before and after rebase
read 32768/32768 bytes at offset 0
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 32768/32768 bytes at offset 32768
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 917504/917504 bytes at offset 65536
896 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 32768/32768 bytes at offset 983040
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 32768/32768 bytes at offset 1015808
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# verify that only selected subclusters remain allocated
Offset Length Mapped to File
0x8000 0x8000 0x508000 TEST_DIR/t.qcow2.top
0xf0000 0x8000 0x5f0000 TEST_DIR/t.qcow2.top
# verify image bitmap
L2 entry #0: 0x8000000000500000 0000000040000002
### Rebase with compression for images with subclusters ###
# create backing chain
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3145728
Formatting 'TEST_DIR/t.IMGFMT.mid', fmt=IMGFMT size=3145728 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
Formatting 'TEST_DIR/t.IMGFMT.top', fmt=IMGFMT size=3145728 backing_file=TEST_DIR/t.IMGFMT.mid backing_fmt=IMGFMT
# fill old and new backing with data
wrote 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 32768/32768 bytes at offset 1015808
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 32768/32768 bytes at offset 2097152
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# rebase topmost image onto the new backing, with compression
# verify that the 1st and 3rd clusters've become compressed
[{ "start": 0, "length": 1048576, "depth": 0, "present": true, "zero": false, "data": true, "compressed": true},
{ "start": 1048576, "length": 1048576, "depth": 1, "present": true, "zero": false, "data": true, "compressed": false, "offset": 5242880},
{ "start": 2097152, "length": 1048576, "depth": 0, "present": true, "zero": false, "data": true, "compressed": true}]
# verify that data is read the same before and after rebase
read 32768/32768 bytes at offset 1015808
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 32768/32768 bytes at offset 2097152
32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
# verify image bitmap
L2 entry #0: 0x4008000000500000 0000000000000000
L2 entry #1: 0x0000000000000000 0000000000000000
L2 entry #2: 0x400800000050040b 0000000000000000
*** done
|