qapi: Improve reporting of redefinition
[qemu/armbru.git] / tests / qemu-iotests / 257.out
blob84b79d7bfe905fd6f047b76c2dac2f96b48acebf
2 === Mode bitmap; Bitmap Sync never with simulated failure ===
4 --- Preparing image & VM ---
6 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
7 {"return": {}}
8 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
9 {"return": {}}
11 --- Write #0 ---
13 write -P0x49 0x0000000 0x10000
14 {"return": ""}
15 write -P0x6c 0x0100000 0x10000
16 {"return": ""}
17 write -P0x6f 0x2000000 0x10000
18 {"return": ""}
19 write -P0x76 0x3ff0000 0x10000
20 {"return": ""}
22   "bitmaps": {
23     "device0": []
24   }
27 --- Reference Backup #0 ---
30 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
31 {"return": {}}
34 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
35 {"return": {}}
37 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
38 {"return": {}}
39 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
41 --- Add Bitmap ---
43 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
44 {"return": {}}
46 --- Write #1 ---
48 write -P0x65 0x0000000 0x10000
49 {"return": ""}
50 write -P0x77 0x00f8000 0x10000
51 {"return": ""}
52 write -P0x72 0x2008000 0x10000
53 {"return": ""}
54 write -P0x69 0x3fe0000 0x10000
55 {"return": ""}
57   "bitmaps": {
58     "device0": [
59       {
60         "busy": false,
61         "count": 393216,
62         "granularity": 65536,
63         "name": "bitmap0",
64         "persistent": false,
65         "recording": true,
66         "status": "active"
67       }
68     ]
69   }
72 = Checking Bitmap bitmap0 =
73 expecting 6 dirty sectors; have 6. OK!
75 --- Reference Backup #1 ---
78 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
79 {"return": {}}
82 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
83 {"return": {}}
85 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
86 {"return": {}}
87 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
89 --- Test Backup #1 ---
92 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
93 {"return": {}}
96 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
97 {"return": {}}
99 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
100 {"return": {}}
102 --- Write #2 ---
104 write -P0x74 0x0010000 0x10000
105 {"return": ""}
106 write -P0x69 0x00e8000 0x10000
107 {"return": ""}
108 write -P0x6e 0x2018000 0x10000
109 {"return": ""}
110 write -P0x67 0x3fe0000 0x20000
111 {"return": ""}
113   "bitmaps": {
114     "device0": [
115       {
116         "busy": false,
117         "count": 0,
118         "granularity": 65536,
119         "persistent": false,
120         "recording": false,
121         "status": "disabled"
122       },
123       {
124         "busy": false,
125         "count": 458752,
126         "granularity": 65536,
127         "persistent": false,
128         "recording": true,
129         "status": "active"
130       },
131       {
132         "busy": true,
133         "count": 393216,
134         "granularity": 65536,
135         "name": "bitmap0",
136         "persistent": false,
137         "recording": true,
138         "status": "frozen"
139       }
140     ]
141   }
144 = Checking Bitmap bitmap0 =
145 expecting 6 dirty sectors; have 6. OK!
147 = Checking Bitmap (anonymous) =
148 expecting 7 dirty sectors; have 7. OK!
150 {"execute": "job-cancel", "arguments": {"id": "backup_1"}}
151 {"return": {}}
152 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
153 {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
155   "bitmaps": {
156     "device0": [
157       {
158         "busy": false,
159         "count": 655360,
160         "granularity": 65536,
161         "name": "bitmap0",
162         "persistent": false,
163         "recording": true,
164         "status": "active"
165       }
166     ]
167   }
170 = Checking Bitmap bitmap0 =
171 expecting 10 dirty sectors; have 10. OK!
173 --- Write #3 ---
175 write -P0xaa 0x0010000 0x30000
176 {"return": ""}
177 write -P0xbb 0x00d8000 0x10000
178 {"return": ""}
179 write -P0xcc 0x2028000 0x10000
180 {"return": ""}
181 write -P0xdd 0x3fc0000 0x10000
182 {"return": ""}
184   "bitmaps": {
185     "device0": [
186       {
187         "busy": false,
188         "count": 983040,
189         "granularity": 65536,
190         "name": "bitmap0",
191         "persistent": false,
192         "recording": true,
193         "status": "active"
194       }
195     ]
196   }
199 = Checking Bitmap bitmap0 =
200 expecting 15 dirty sectors; have 15. OK!
202 --- Reference Backup #2 ---
205 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
206 {"return": {}}
209 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
210 {"return": {}}
212 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
213 {"return": {}}
214 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
216 --- Test Backup #2 ---
219 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
220 {"return": {}}
223 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
224 {"return": {}}
226 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
227 {"return": {}}
228 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
229 {"return": {}}
230 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
231 {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
233   "bitmaps": {
234     "device0": [
235       {
236         "busy": false,
237         "count": 983040,
238         "granularity": 65536,
239         "name": "bitmap0",
240         "persistent": false,
241         "recording": true,
242         "status": "active"
243       }
244     ]
245   }
248 = Checking Bitmap bitmap0 =
249 expecting 15 dirty sectors; have 15. OK!
251 --- Cleanup ---
253 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
254 {"return": {}}
256   "bitmaps": {
257     "device0": []
258   }
261 --- Verification ---
263 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
264 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
265 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
268 === Mode bitmap; Bitmap Sync never with intermediate failure ===
270 --- Preparing image & VM ---
272 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false, "once": true, "state": 3}], "set-state": [{"event": "flush_to_disk", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]}, "node-name": "drive0"}}
273 {"return": {}}
274 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
275 {"return": {}}
277 --- Write #0 ---
279 write -P0x49 0x0000000 0x10000
280 {"return": ""}
281 write -P0x6c 0x0100000 0x10000
282 {"return": ""}
283 write -P0x6f 0x2000000 0x10000
284 {"return": ""}
285 write -P0x76 0x3ff0000 0x10000
286 {"return": ""}
288   "bitmaps": {
289     "device0": []
290   }
293 --- Reference Backup #0 ---
296 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
297 {"return": {}}
300 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
301 {"return": {}}
303 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
304 {"return": {}}
305 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
307 --- Add Bitmap ---
309 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
310 {"return": {}}
312 --- Write #1 ---
314 write -P0x65 0x0000000 0x10000
315 {"return": ""}
316 write -P0x77 0x00f8000 0x10000
317 {"return": ""}
318 write -P0x72 0x2008000 0x10000
319 {"return": ""}
320 write -P0x69 0x3fe0000 0x10000
321 {"return": ""}
323   "bitmaps": {
324     "device0": [
325       {
326         "busy": false,
327         "count": 393216,
328         "granularity": 65536,
329         "name": "bitmap0",
330         "persistent": false,
331         "recording": true,
332         "status": "active"
333       }
334     ]
335   }
338 = Checking Bitmap bitmap0 =
339 expecting 6 dirty sectors; have 6. OK!
341 --- Reference Backup #1 ---
344 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
345 {"return": {}}
348 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
349 {"return": {}}
351 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
352 {"return": {}}
353 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
355 {"return": ""}
357 --- Test Backup #1 ---
360 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
361 {"return": {}}
364 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
365 {"return": {}}
367 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
368 {"return": {}}
369 {"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
370 {"data": {"device": "backup_1", "error": "Input/output error", "len": 393216, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
372   "bitmaps": {
373     "device0": [
374       {
375         "busy": false,
376         "count": 393216,
377         "granularity": 65536,
378         "name": "bitmap0",
379         "persistent": false,
380         "recording": true,
381         "status": "active"
382       }
383     ]
384   }
387 = Checking Bitmap bitmap0 =
388 expecting 6 dirty sectors; have 6. OK!
390 --- Write #3 ---
392 write -P0xaa 0x0010000 0x30000
393 {"return": ""}
394 write -P0xbb 0x00d8000 0x10000
395 {"return": ""}
396 write -P0xcc 0x2028000 0x10000
397 {"return": ""}
398 write -P0xdd 0x3fc0000 0x10000
399 {"return": ""}
401   "bitmaps": {
402     "device0": [
403       {
404         "busy": false,
405         "count": 917504,
406         "granularity": 65536,
407         "name": "bitmap0",
408         "persistent": false,
409         "recording": true,
410         "status": "active"
411       }
412     ]
413   }
416 = Checking Bitmap bitmap0 =
417 expecting 14 dirty sectors; have 14. OK!
419 --- Reference Backup #2 ---
422 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
423 {"return": {}}
426 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
427 {"return": {}}
429 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
430 {"return": {}}
431 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
433 --- Test Backup #2 ---
436 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
437 {"return": {}}
440 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
441 {"return": {}}
443 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
444 {"return": {}}
445 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
446 {"return": {}}
447 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
448 {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
450   "bitmaps": {
451     "device0": [
452       {
453         "busy": false,
454         "count": 917504,
455         "granularity": 65536,
456         "name": "bitmap0",
457         "persistent": false,
458         "recording": true,
459         "status": "active"
460       }
461     ]
462   }
465 = Checking Bitmap bitmap0 =
466 expecting 14 dirty sectors; have 14. OK!
468 --- Cleanup ---
470 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
471 {"return": {}}
473   "bitmaps": {
474     "device0": []
475   }
478 --- Verification ---
480 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
481 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
482 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
485 === Mode bitmap; Bitmap Sync never without failure ===
487 --- Preparing image & VM ---
489 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
490 {"return": {}}
491 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
492 {"return": {}}
494 --- Write #0 ---
496 write -P0x49 0x0000000 0x10000
497 {"return": ""}
498 write -P0x6c 0x0100000 0x10000
499 {"return": ""}
500 write -P0x6f 0x2000000 0x10000
501 {"return": ""}
502 write -P0x76 0x3ff0000 0x10000
503 {"return": ""}
505   "bitmaps": {
506     "device0": []
507   }
510 --- Reference Backup #0 ---
513 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
514 {"return": {}}
517 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
518 {"return": {}}
520 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
521 {"return": {}}
522 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
524 --- Add Bitmap ---
526 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
527 {"return": {}}
529 --- Write #1 ---
531 write -P0x65 0x0000000 0x10000
532 {"return": ""}
533 write -P0x77 0x00f8000 0x10000
534 {"return": ""}
535 write -P0x72 0x2008000 0x10000
536 {"return": ""}
537 write -P0x69 0x3fe0000 0x10000
538 {"return": ""}
540   "bitmaps": {
541     "device0": [
542       {
543         "busy": false,
544         "count": 393216,
545         "granularity": 65536,
546         "name": "bitmap0",
547         "persistent": false,
548         "recording": true,
549         "status": "active"
550       }
551     ]
552   }
555 = Checking Bitmap bitmap0 =
556 expecting 6 dirty sectors; have 6. OK!
558 --- Reference Backup #1 ---
561 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
562 {"return": {}}
565 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
566 {"return": {}}
568 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
569 {"return": {}}
570 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
572 --- Test Backup #1 ---
575 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
576 {"return": {}}
579 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
580 {"return": {}}
582 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
583 {"return": {}}
585 --- Write #2 ---
587 write -P0x74 0x0010000 0x10000
588 {"return": ""}
589 write -P0x69 0x00e8000 0x10000
590 {"return": ""}
591 write -P0x6e 0x2018000 0x10000
592 {"return": ""}
593 write -P0x67 0x3fe0000 0x20000
594 {"return": ""}
596   "bitmaps": {
597     "device0": [
598       {
599         "busy": false,
600         "count": 0,
601         "granularity": 65536,
602         "persistent": false,
603         "recording": false,
604         "status": "disabled"
605       },
606       {
607         "busy": false,
608         "count": 458752,
609         "granularity": 65536,
610         "persistent": false,
611         "recording": true,
612         "status": "active"
613       },
614       {
615         "busy": true,
616         "count": 393216,
617         "granularity": 65536,
618         "name": "bitmap0",
619         "persistent": false,
620         "recording": true,
621         "status": "frozen"
622       }
623     ]
624   }
627 = Checking Bitmap bitmap0 =
628 expecting 6 dirty sectors; have 6. OK!
630 = Checking Bitmap (anonymous) =
631 expecting 7 dirty sectors; have 7. OK!
633 {"execute": "job-finalize", "arguments": {"id": "backup_1"}}
634 {"return": {}}
635 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
636 {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
638   "bitmaps": {
639     "device0": [
640       {
641         "busy": false,
642         "count": 655360,
643         "granularity": 65536,
644         "name": "bitmap0",
645         "persistent": false,
646         "recording": true,
647         "status": "active"
648       }
649     ]
650   }
653 = Checking Bitmap bitmap0 =
654 expecting 10 dirty sectors; have 10. OK!
656 --- Write #3 ---
658 write -P0xaa 0x0010000 0x30000
659 {"return": ""}
660 write -P0xbb 0x00d8000 0x10000
661 {"return": ""}
662 write -P0xcc 0x2028000 0x10000
663 {"return": ""}
664 write -P0xdd 0x3fc0000 0x10000
665 {"return": ""}
667   "bitmaps": {
668     "device0": [
669       {
670         "busy": false,
671         "count": 983040,
672         "granularity": 65536,
673         "name": "bitmap0",
674         "persistent": false,
675         "recording": true,
676         "status": "active"
677       }
678     ]
679   }
682 = Checking Bitmap bitmap0 =
683 expecting 15 dirty sectors; have 15. OK!
685 --- Reference Backup #2 ---
688 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
689 {"return": {}}
692 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
693 {"return": {}}
695 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
696 {"return": {}}
697 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
699 --- Test Backup #2 ---
702 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
703 {"return": {}}
706 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
707 {"return": {}}
709 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
710 {"return": {}}
711 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
712 {"return": {}}
713 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
714 {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
716   "bitmaps": {
717     "device0": [
718       {
719         "busy": false,
720         "count": 983040,
721         "granularity": 65536,
722         "name": "bitmap0",
723         "persistent": false,
724         "recording": true,
725         "status": "active"
726       }
727     ]
728   }
731 = Checking Bitmap bitmap0 =
732 expecting 15 dirty sectors; have 15. OK!
734 --- Cleanup ---
736 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
737 {"return": {}}
739   "bitmaps": {
740     "device0": []
741   }
744 --- Verification ---
746 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
747 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
748 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
751 === Mode bitmap; Bitmap Sync on-success with simulated failure ===
753 --- Preparing image & VM ---
755 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
756 {"return": {}}
757 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
758 {"return": {}}
760 --- Write #0 ---
762 write -P0x49 0x0000000 0x10000
763 {"return": ""}
764 write -P0x6c 0x0100000 0x10000
765 {"return": ""}
766 write -P0x6f 0x2000000 0x10000
767 {"return": ""}
768 write -P0x76 0x3ff0000 0x10000
769 {"return": ""}
771   "bitmaps": {
772     "device0": []
773   }
776 --- Reference Backup #0 ---
779 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
780 {"return": {}}
783 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
784 {"return": {}}
786 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
787 {"return": {}}
788 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
790 --- Add Bitmap ---
792 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
793 {"return": {}}
795 --- Write #1 ---
797 write -P0x65 0x0000000 0x10000
798 {"return": ""}
799 write -P0x77 0x00f8000 0x10000
800 {"return": ""}
801 write -P0x72 0x2008000 0x10000
802 {"return": ""}
803 write -P0x69 0x3fe0000 0x10000
804 {"return": ""}
806   "bitmaps": {
807     "device0": [
808       {
809         "busy": false,
810         "count": 393216,
811         "granularity": 65536,
812         "name": "bitmap0",
813         "persistent": false,
814         "recording": true,
815         "status": "active"
816       }
817     ]
818   }
821 = Checking Bitmap bitmap0 =
822 expecting 6 dirty sectors; have 6. OK!
824 --- Reference Backup #1 ---
827 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
828 {"return": {}}
831 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
832 {"return": {}}
834 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
835 {"return": {}}
836 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
838 --- Test Backup #1 ---
841 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
842 {"return": {}}
845 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
846 {"return": {}}
848 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
849 {"return": {}}
851 --- Write #2 ---
853 write -P0x74 0x0010000 0x10000
854 {"return": ""}
855 write -P0x69 0x00e8000 0x10000
856 {"return": ""}
857 write -P0x6e 0x2018000 0x10000
858 {"return": ""}
859 write -P0x67 0x3fe0000 0x20000
860 {"return": ""}
862   "bitmaps": {
863     "device0": [
864       {
865         "busy": false,
866         "count": 0,
867         "granularity": 65536,
868         "persistent": false,
869         "recording": false,
870         "status": "disabled"
871       },
872       {
873         "busy": false,
874         "count": 458752,
875         "granularity": 65536,
876         "persistent": false,
877         "recording": true,
878         "status": "active"
879       },
880       {
881         "busy": true,
882         "count": 393216,
883         "granularity": 65536,
884         "name": "bitmap0",
885         "persistent": false,
886         "recording": true,
887         "status": "frozen"
888       }
889     ]
890   }
893 = Checking Bitmap bitmap0 =
894 expecting 6 dirty sectors; have 6. OK!
896 = Checking Bitmap (anonymous) =
897 expecting 7 dirty sectors; have 7. OK!
899 {"execute": "job-cancel", "arguments": {"id": "backup_1"}}
900 {"return": {}}
901 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
902 {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
904   "bitmaps": {
905     "device0": [
906       {
907         "busy": false,
908         "count": 655360,
909         "granularity": 65536,
910         "name": "bitmap0",
911         "persistent": false,
912         "recording": true,
913         "status": "active"
914       }
915     ]
916   }
919 = Checking Bitmap bitmap0 =
920 expecting 10 dirty sectors; have 10. OK!
922 --- Write #3 ---
924 write -P0xaa 0x0010000 0x30000
925 {"return": ""}
926 write -P0xbb 0x00d8000 0x10000
927 {"return": ""}
928 write -P0xcc 0x2028000 0x10000
929 {"return": ""}
930 write -P0xdd 0x3fc0000 0x10000
931 {"return": ""}
933   "bitmaps": {
934     "device0": [
935       {
936         "busy": false,
937         "count": 983040,
938         "granularity": 65536,
939         "name": "bitmap0",
940         "persistent": false,
941         "recording": true,
942         "status": "active"
943       }
944     ]
945   }
948 = Checking Bitmap bitmap0 =
949 expecting 15 dirty sectors; have 15. OK!
951 --- Reference Backup #2 ---
954 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
955 {"return": {}}
958 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
959 {"return": {}}
961 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
962 {"return": {}}
963 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
965 --- Test Backup #2 ---
968 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
969 {"return": {}}
972 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
973 {"return": {}}
975 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
976 {"return": {}}
977 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
978 {"return": {}}
979 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
980 {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
982   "bitmaps": {
983     "device0": [
984       {
985         "busy": false,
986         "count": 0,
987         "granularity": 65536,
988         "name": "bitmap0",
989         "persistent": false,
990         "recording": true,
991         "status": "active"
992       }
993     ]
994   }
997 = Checking Bitmap bitmap0 =
998 expecting 0 dirty sectors; have 0. OK!
1000 --- Cleanup ---
1002 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
1003 {"return": {}}
1005   "bitmaps": {
1006     "device0": []
1007   }
1010 --- Verification ---
1012 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
1013 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1014 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1017 === Mode bitmap; Bitmap Sync on-success with intermediate failure ===
1019 --- Preparing image & VM ---
1021 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false, "once": true, "state": 3}], "set-state": [{"event": "flush_to_disk", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]}, "node-name": "drive0"}}
1022 {"return": {}}
1023 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
1024 {"return": {}}
1026 --- Write #0 ---
1028 write -P0x49 0x0000000 0x10000
1029 {"return": ""}
1030 write -P0x6c 0x0100000 0x10000
1031 {"return": ""}
1032 write -P0x6f 0x2000000 0x10000
1033 {"return": ""}
1034 write -P0x76 0x3ff0000 0x10000
1035 {"return": ""}
1037   "bitmaps": {
1038     "device0": []
1039   }
1042 --- Reference Backup #0 ---
1045 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1046 {"return": {}}
1049 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1050 {"return": {}}
1052 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
1053 {"return": {}}
1054 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1056 --- Add Bitmap ---
1058 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
1059 {"return": {}}
1061 --- Write #1 ---
1063 write -P0x65 0x0000000 0x10000
1064 {"return": ""}
1065 write -P0x77 0x00f8000 0x10000
1066 {"return": ""}
1067 write -P0x72 0x2008000 0x10000
1068 {"return": ""}
1069 write -P0x69 0x3fe0000 0x10000
1070 {"return": ""}
1072   "bitmaps": {
1073     "device0": [
1074       {
1075         "busy": false,
1076         "count": 393216,
1077         "granularity": 65536,
1078         "name": "bitmap0",
1079         "persistent": false,
1080         "recording": true,
1081         "status": "active"
1082       }
1083     ]
1084   }
1087 = Checking Bitmap bitmap0 =
1088 expecting 6 dirty sectors; have 6. OK!
1090 --- Reference Backup #1 ---
1093 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1094 {"return": {}}
1097 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1098 {"return": {}}
1100 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
1101 {"return": {}}
1102 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1104 {"return": ""}
1106 --- Test Backup #1 ---
1109 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1110 {"return": {}}
1113 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1114 {"return": {}}
1116 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
1117 {"return": {}}
1118 {"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1119 {"data": {"device": "backup_1", "error": "Input/output error", "len": 393216, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1121   "bitmaps": {
1122     "device0": [
1123       {
1124         "busy": false,
1125         "count": 393216,
1126         "granularity": 65536,
1127         "name": "bitmap0",
1128         "persistent": false,
1129         "recording": true,
1130         "status": "active"
1131       }
1132     ]
1133   }
1136 = Checking Bitmap bitmap0 =
1137 expecting 6 dirty sectors; have 6. OK!
1139 --- Write #3 ---
1141 write -P0xaa 0x0010000 0x30000
1142 {"return": ""}
1143 write -P0xbb 0x00d8000 0x10000
1144 {"return": ""}
1145 write -P0xcc 0x2028000 0x10000
1146 {"return": ""}
1147 write -P0xdd 0x3fc0000 0x10000
1148 {"return": ""}
1150   "bitmaps": {
1151     "device0": [
1152       {
1153         "busy": false,
1154         "count": 917504,
1155         "granularity": 65536,
1156         "name": "bitmap0",
1157         "persistent": false,
1158         "recording": true,
1159         "status": "active"
1160       }
1161     ]
1162   }
1165 = Checking Bitmap bitmap0 =
1166 expecting 14 dirty sectors; have 14. OK!
1168 --- Reference Backup #2 ---
1171 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1172 {"return": {}}
1175 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1176 {"return": {}}
1178 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
1179 {"return": {}}
1180 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1182 --- Test Backup #2 ---
1185 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1186 {"return": {}}
1189 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1190 {"return": {}}
1192 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
1193 {"return": {}}
1194 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
1195 {"return": {}}
1196 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1197 {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1199   "bitmaps": {
1200     "device0": [
1201       {
1202         "busy": false,
1203         "count": 0,
1204         "granularity": 65536,
1205         "name": "bitmap0",
1206         "persistent": false,
1207         "recording": true,
1208         "status": "active"
1209       }
1210     ]
1211   }
1214 = Checking Bitmap bitmap0 =
1215 expecting 0 dirty sectors; have 0. OK!
1217 --- Cleanup ---
1219 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
1220 {"return": {}}
1222   "bitmaps": {
1223     "device0": []
1224   }
1227 --- Verification ---
1229 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
1230 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1231 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1234 === Mode bitmap; Bitmap Sync on-success without failure ===
1236 --- Preparing image & VM ---
1238 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
1239 {"return": {}}
1240 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
1241 {"return": {}}
1243 --- Write #0 ---
1245 write -P0x49 0x0000000 0x10000
1246 {"return": ""}
1247 write -P0x6c 0x0100000 0x10000
1248 {"return": ""}
1249 write -P0x6f 0x2000000 0x10000
1250 {"return": ""}
1251 write -P0x76 0x3ff0000 0x10000
1252 {"return": ""}
1254   "bitmaps": {
1255     "device0": []
1256   }
1259 --- Reference Backup #0 ---
1262 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1263 {"return": {}}
1266 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1267 {"return": {}}
1269 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
1270 {"return": {}}
1271 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1273 --- Add Bitmap ---
1275 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
1276 {"return": {}}
1278 --- Write #1 ---
1280 write -P0x65 0x0000000 0x10000
1281 {"return": ""}
1282 write -P0x77 0x00f8000 0x10000
1283 {"return": ""}
1284 write -P0x72 0x2008000 0x10000
1285 {"return": ""}
1286 write -P0x69 0x3fe0000 0x10000
1287 {"return": ""}
1289   "bitmaps": {
1290     "device0": [
1291       {
1292         "busy": false,
1293         "count": 393216,
1294         "granularity": 65536,
1295         "name": "bitmap0",
1296         "persistent": false,
1297         "recording": true,
1298         "status": "active"
1299       }
1300     ]
1301   }
1304 = Checking Bitmap bitmap0 =
1305 expecting 6 dirty sectors; have 6. OK!
1307 --- Reference Backup #1 ---
1310 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1311 {"return": {}}
1314 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1315 {"return": {}}
1317 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
1318 {"return": {}}
1319 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1321 --- Test Backup #1 ---
1324 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1325 {"return": {}}
1328 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1329 {"return": {}}
1331 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
1332 {"return": {}}
1334 --- Write #2 ---
1336 write -P0x74 0x0010000 0x10000
1337 {"return": ""}
1338 write -P0x69 0x00e8000 0x10000
1339 {"return": ""}
1340 write -P0x6e 0x2018000 0x10000
1341 {"return": ""}
1342 write -P0x67 0x3fe0000 0x20000
1343 {"return": ""}
1345   "bitmaps": {
1346     "device0": [
1347       {
1348         "busy": false,
1349         "count": 0,
1350         "granularity": 65536,
1351         "persistent": false,
1352         "recording": false,
1353         "status": "disabled"
1354       },
1355       {
1356         "busy": false,
1357         "count": 458752,
1358         "granularity": 65536,
1359         "persistent": false,
1360         "recording": true,
1361         "status": "active"
1362       },
1363       {
1364         "busy": true,
1365         "count": 393216,
1366         "granularity": 65536,
1367         "name": "bitmap0",
1368         "persistent": false,
1369         "recording": true,
1370         "status": "frozen"
1371       }
1372     ]
1373   }
1376 = Checking Bitmap bitmap0 =
1377 expecting 6 dirty sectors; have 6. OK!
1379 = Checking Bitmap (anonymous) =
1380 expecting 7 dirty sectors; have 7. OK!
1382 {"execute": "job-finalize", "arguments": {"id": "backup_1"}}
1383 {"return": {}}
1384 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1385 {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1387   "bitmaps": {
1388     "device0": [
1389       {
1390         "busy": false,
1391         "count": 458752,
1392         "granularity": 65536,
1393         "name": "bitmap0",
1394         "persistent": false,
1395         "recording": true,
1396         "status": "active"
1397       }
1398     ]
1399   }
1402 = Checking Bitmap bitmap0 =
1403 expecting 7 dirty sectors; have 7. OK!
1405 --- Write #3 ---
1407 write -P0xaa 0x0010000 0x30000
1408 {"return": ""}
1409 write -P0xbb 0x00d8000 0x10000
1410 {"return": ""}
1411 write -P0xcc 0x2028000 0x10000
1412 {"return": ""}
1413 write -P0xdd 0x3fc0000 0x10000
1414 {"return": ""}
1416   "bitmaps": {
1417     "device0": [
1418       {
1419         "busy": false,
1420         "count": 786432,
1421         "granularity": 65536,
1422         "name": "bitmap0",
1423         "persistent": false,
1424         "recording": true,
1425         "status": "active"
1426       }
1427     ]
1428   }
1431 = Checking Bitmap bitmap0 =
1432 expecting 12 dirty sectors; have 12. OK!
1434 --- Reference Backup #2 ---
1437 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1438 {"return": {}}
1441 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1442 {"return": {}}
1444 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
1445 {"return": {}}
1446 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1448 --- Test Backup #2 ---
1451 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1452 {"return": {}}
1455 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1456 {"return": {}}
1458 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
1459 {"return": {}}
1460 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
1461 {"return": {}}
1462 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1463 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1465   "bitmaps": {
1466     "device0": [
1467       {
1468         "busy": false,
1469         "count": 0,
1470         "granularity": 65536,
1471         "name": "bitmap0",
1472         "persistent": false,
1473         "recording": true,
1474         "status": "active"
1475       }
1476     ]
1477   }
1480 = Checking Bitmap bitmap0 =
1481 expecting 0 dirty sectors; have 0. OK!
1483 --- Cleanup ---
1485 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
1486 {"return": {}}
1488   "bitmaps": {
1489     "device0": []
1490   }
1493 --- Verification ---
1495 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
1496 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1497 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1500 === Mode bitmap; Bitmap Sync always with simulated failure ===
1502 --- Preparing image & VM ---
1504 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
1505 {"return": {}}
1506 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
1507 {"return": {}}
1509 --- Write #0 ---
1511 write -P0x49 0x0000000 0x10000
1512 {"return": ""}
1513 write -P0x6c 0x0100000 0x10000
1514 {"return": ""}
1515 write -P0x6f 0x2000000 0x10000
1516 {"return": ""}
1517 write -P0x76 0x3ff0000 0x10000
1518 {"return": ""}
1520   "bitmaps": {
1521     "device0": []
1522   }
1525 --- Reference Backup #0 ---
1528 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1529 {"return": {}}
1532 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1533 {"return": {}}
1535 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
1536 {"return": {}}
1537 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1539 --- Add Bitmap ---
1541 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
1542 {"return": {}}
1544 --- Write #1 ---
1546 write -P0x65 0x0000000 0x10000
1547 {"return": ""}
1548 write -P0x77 0x00f8000 0x10000
1549 {"return": ""}
1550 write -P0x72 0x2008000 0x10000
1551 {"return": ""}
1552 write -P0x69 0x3fe0000 0x10000
1553 {"return": ""}
1555   "bitmaps": {
1556     "device0": [
1557       {
1558         "busy": false,
1559         "count": 393216,
1560         "granularity": 65536,
1561         "name": "bitmap0",
1562         "persistent": false,
1563         "recording": true,
1564         "status": "active"
1565       }
1566     ]
1567   }
1570 = Checking Bitmap bitmap0 =
1571 expecting 6 dirty sectors; have 6. OK!
1573 --- Reference Backup #1 ---
1576 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1577 {"return": {}}
1580 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1581 {"return": {}}
1583 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
1584 {"return": {}}
1585 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1587 --- Test Backup #1 ---
1590 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1591 {"return": {}}
1594 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1595 {"return": {}}
1597 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
1598 {"return": {}}
1600 --- Write #2 ---
1602 write -P0x74 0x0010000 0x10000
1603 {"return": ""}
1604 write -P0x69 0x00e8000 0x10000
1605 {"return": ""}
1606 write -P0x6e 0x2018000 0x10000
1607 {"return": ""}
1608 write -P0x67 0x3fe0000 0x20000
1609 {"return": ""}
1611   "bitmaps": {
1612     "device0": [
1613       {
1614         "busy": false,
1615         "count": 0,
1616         "granularity": 65536,
1617         "persistent": false,
1618         "recording": false,
1619         "status": "disabled"
1620       },
1621       {
1622         "busy": false,
1623         "count": 458752,
1624         "granularity": 65536,
1625         "persistent": false,
1626         "recording": true,
1627         "status": "active"
1628       },
1629       {
1630         "busy": true,
1631         "count": 393216,
1632         "granularity": 65536,
1633         "name": "bitmap0",
1634         "persistent": false,
1635         "recording": true,
1636         "status": "frozen"
1637       }
1638     ]
1639   }
1642 = Checking Bitmap bitmap0 =
1643 expecting 6 dirty sectors; have 6. OK!
1645 = Checking Bitmap (anonymous) =
1646 expecting 7 dirty sectors; have 7. OK!
1648 {"execute": "job-cancel", "arguments": {"id": "backup_1"}}
1649 {"return": {}}
1650 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1651 {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1653   "bitmaps": {
1654     "device0": [
1655       {
1656         "busy": false,
1657         "count": 458752,
1658         "granularity": 65536,
1659         "name": "bitmap0",
1660         "persistent": false,
1661         "recording": true,
1662         "status": "active"
1663       }
1664     ]
1665   }
1668 = Checking Bitmap bitmap0 =
1669 expecting 7 dirty sectors; have 7. OK!
1671 --- Write #3 ---
1673 write -P0xaa 0x0010000 0x30000
1674 {"return": ""}
1675 write -P0xbb 0x00d8000 0x10000
1676 {"return": ""}
1677 write -P0xcc 0x2028000 0x10000
1678 {"return": ""}
1679 write -P0xdd 0x3fc0000 0x10000
1680 {"return": ""}
1682   "bitmaps": {
1683     "device0": [
1684       {
1685         "busy": false,
1686         "count": 786432,
1687         "granularity": 65536,
1688         "name": "bitmap0",
1689         "persistent": false,
1690         "recording": true,
1691         "status": "active"
1692       }
1693     ]
1694   }
1697 = Checking Bitmap bitmap0 =
1698 expecting 12 dirty sectors; have 12. OK!
1700 --- Reference Backup #2 ---
1703 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1704 {"return": {}}
1707 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1708 {"return": {}}
1710 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
1711 {"return": {}}
1712 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1714 --- Test Backup #2 ---
1717 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1718 {"return": {}}
1721 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1722 {"return": {}}
1724 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
1725 {"return": {}}
1726 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
1727 {"return": {}}
1728 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1729 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1731   "bitmaps": {
1732     "device0": [
1733       {
1734         "busy": false,
1735         "count": 0,
1736         "granularity": 65536,
1737         "name": "bitmap0",
1738         "persistent": false,
1739         "recording": true,
1740         "status": "active"
1741       }
1742     ]
1743   }
1746 = Checking Bitmap bitmap0 =
1747 expecting 0 dirty sectors; have 0. OK!
1749 --- Cleanup ---
1751 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
1752 {"return": {}}
1754   "bitmaps": {
1755     "device0": []
1756   }
1759 --- Verification ---
1761 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
1762 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1763 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1766 === Mode bitmap; Bitmap Sync always with intermediate failure ===
1768 --- Preparing image & VM ---
1770 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false, "once": true, "state": 3}], "set-state": [{"event": "flush_to_disk", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]}, "node-name": "drive0"}}
1771 {"return": {}}
1772 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
1773 {"return": {}}
1775 --- Write #0 ---
1777 write -P0x49 0x0000000 0x10000
1778 {"return": ""}
1779 write -P0x6c 0x0100000 0x10000
1780 {"return": ""}
1781 write -P0x6f 0x2000000 0x10000
1782 {"return": ""}
1783 write -P0x76 0x3ff0000 0x10000
1784 {"return": ""}
1786   "bitmaps": {
1787     "device0": []
1788   }
1791 --- Reference Backup #0 ---
1794 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1795 {"return": {}}
1798 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1799 {"return": {}}
1801 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
1802 {"return": {}}
1803 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1805 --- Add Bitmap ---
1807 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
1808 {"return": {}}
1810 --- Write #1 ---
1812 write -P0x65 0x0000000 0x10000
1813 {"return": ""}
1814 write -P0x77 0x00f8000 0x10000
1815 {"return": ""}
1816 write -P0x72 0x2008000 0x10000
1817 {"return": ""}
1818 write -P0x69 0x3fe0000 0x10000
1819 {"return": ""}
1821   "bitmaps": {
1822     "device0": [
1823       {
1824         "busy": false,
1825         "count": 393216,
1826         "granularity": 65536,
1827         "name": "bitmap0",
1828         "persistent": false,
1829         "recording": true,
1830         "status": "active"
1831       }
1832     ]
1833   }
1836 = Checking Bitmap bitmap0 =
1837 expecting 6 dirty sectors; have 6. OK!
1839 --- Reference Backup #1 ---
1842 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1843 {"return": {}}
1846 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1847 {"return": {}}
1849 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
1850 {"return": {}}
1851 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1853 {"return": ""}
1855 --- Test Backup #1 ---
1858 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1859 {"return": {}}
1862 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1863 {"return": {}}
1865 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
1866 {"return": {}}
1867 {"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1868 {"data": {"device": "backup_1", "error": "Input/output error", "len": 393216, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1870   "bitmaps": {
1871     "device0": [
1872       {
1873         "busy": false,
1874         "count": 327680,
1875         "granularity": 65536,
1876         "name": "bitmap0",
1877         "persistent": false,
1878         "recording": true,
1879         "status": "active"
1880       }
1881     ]
1882   }
1885 = Checking Bitmap bitmap0 =
1886 expecting 5 dirty sectors; have 5. OK!
1888 --- Write #3 ---
1890 write -P0xaa 0x0010000 0x30000
1891 {"return": ""}
1892 write -P0xbb 0x00d8000 0x10000
1893 {"return": ""}
1894 write -P0xcc 0x2028000 0x10000
1895 {"return": ""}
1896 write -P0xdd 0x3fc0000 0x10000
1897 {"return": ""}
1899   "bitmaps": {
1900     "device0": [
1901       {
1902         "busy": false,
1903         "count": 851968,
1904         "granularity": 65536,
1905         "name": "bitmap0",
1906         "persistent": false,
1907         "recording": true,
1908         "status": "active"
1909       }
1910     ]
1911   }
1914 = Checking Bitmap bitmap0 =
1915 expecting 13 dirty sectors; have 13. OK!
1917 --- Reference Backup #2 ---
1920 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1921 {"return": {}}
1924 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1925 {"return": {}}
1927 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
1928 {"return": {}}
1929 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1931 --- Test Backup #2 ---
1934 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
1935 {"return": {}}
1938 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
1939 {"return": {}}
1941 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
1942 {"return": {}}
1943 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
1944 {"return": {}}
1945 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1946 {"data": {"device": "backup_2", "len": 851968, "offset": 851968, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
1948   "bitmaps": {
1949     "device0": [
1950       {
1951         "busy": false,
1952         "count": 0,
1953         "granularity": 65536,
1954         "name": "bitmap0",
1955         "persistent": false,
1956         "recording": true,
1957         "status": "active"
1958       }
1959     ]
1960   }
1963 = Checking Bitmap bitmap0 =
1964 expecting 0 dirty sectors; have 0. OK!
1966 --- Cleanup ---
1968 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
1969 {"return": {}}
1971   "bitmaps": {
1972     "device0": []
1973   }
1976 --- Verification ---
1978 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
1979 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1980 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
1983 === Mode bitmap; Bitmap Sync always without failure ===
1985 --- Preparing image & VM ---
1987 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
1988 {"return": {}}
1989 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
1990 {"return": {}}
1992 --- Write #0 ---
1994 write -P0x49 0x0000000 0x10000
1995 {"return": ""}
1996 write -P0x6c 0x0100000 0x10000
1997 {"return": ""}
1998 write -P0x6f 0x2000000 0x10000
1999 {"return": ""}
2000 write -P0x76 0x3ff0000 0x10000
2001 {"return": ""}
2003   "bitmaps": {
2004     "device0": []
2005   }
2008 --- Reference Backup #0 ---
2011 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2012 {"return": {}}
2015 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2016 {"return": {}}
2018 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
2019 {"return": {}}
2020 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2022 --- Add Bitmap ---
2024 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
2025 {"return": {}}
2027 --- Write #1 ---
2029 write -P0x65 0x0000000 0x10000
2030 {"return": ""}
2031 write -P0x77 0x00f8000 0x10000
2032 {"return": ""}
2033 write -P0x72 0x2008000 0x10000
2034 {"return": ""}
2035 write -P0x69 0x3fe0000 0x10000
2036 {"return": ""}
2038   "bitmaps": {
2039     "device0": [
2040       {
2041         "busy": false,
2042         "count": 393216,
2043         "granularity": 65536,
2044         "name": "bitmap0",
2045         "persistent": false,
2046         "recording": true,
2047         "status": "active"
2048       }
2049     ]
2050   }
2053 = Checking Bitmap bitmap0 =
2054 expecting 6 dirty sectors; have 6. OK!
2056 --- Reference Backup #1 ---
2059 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2060 {"return": {}}
2063 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2064 {"return": {}}
2066 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
2067 {"return": {}}
2068 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2070 --- Test Backup #1 ---
2073 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2074 {"return": {}}
2077 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2078 {"return": {}}
2080 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1"}}
2081 {"return": {}}
2083 --- Write #2 ---
2085 write -P0x74 0x0010000 0x10000
2086 {"return": ""}
2087 write -P0x69 0x00e8000 0x10000
2088 {"return": ""}
2089 write -P0x6e 0x2018000 0x10000
2090 {"return": ""}
2091 write -P0x67 0x3fe0000 0x20000
2092 {"return": ""}
2094   "bitmaps": {
2095     "device0": [
2096       {
2097         "busy": false,
2098         "count": 0,
2099         "granularity": 65536,
2100         "persistent": false,
2101         "recording": false,
2102         "status": "disabled"
2103       },
2104       {
2105         "busy": false,
2106         "count": 458752,
2107         "granularity": 65536,
2108         "persistent": false,
2109         "recording": true,
2110         "status": "active"
2111       },
2112       {
2113         "busy": true,
2114         "count": 393216,
2115         "granularity": 65536,
2116         "name": "bitmap0",
2117         "persistent": false,
2118         "recording": true,
2119         "status": "frozen"
2120       }
2121     ]
2122   }
2125 = Checking Bitmap bitmap0 =
2126 expecting 6 dirty sectors; have 6. OK!
2128 = Checking Bitmap (anonymous) =
2129 expecting 7 dirty sectors; have 7. OK!
2131 {"execute": "job-finalize", "arguments": {"id": "backup_1"}}
2132 {"return": {}}
2133 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2134 {"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2136   "bitmaps": {
2137     "device0": [
2138       {
2139         "busy": false,
2140         "count": 458752,
2141         "granularity": 65536,
2142         "name": "bitmap0",
2143         "persistent": false,
2144         "recording": true,
2145         "status": "active"
2146       }
2147     ]
2148   }
2151 = Checking Bitmap bitmap0 =
2152 expecting 7 dirty sectors; have 7. OK!
2154 --- Write #3 ---
2156 write -P0xaa 0x0010000 0x30000
2157 {"return": ""}
2158 write -P0xbb 0x00d8000 0x10000
2159 {"return": ""}
2160 write -P0xcc 0x2028000 0x10000
2161 {"return": ""}
2162 write -P0xdd 0x3fc0000 0x10000
2163 {"return": ""}
2165   "bitmaps": {
2166     "device0": [
2167       {
2168         "busy": false,
2169         "count": 786432,
2170         "granularity": 65536,
2171         "name": "bitmap0",
2172         "persistent": false,
2173         "recording": true,
2174         "status": "active"
2175       }
2176     ]
2177   }
2180 = Checking Bitmap bitmap0 =
2181 expecting 12 dirty sectors; have 12. OK!
2183 --- Reference Backup #2 ---
2186 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2187 {"return": {}}
2190 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2191 {"return": {}}
2193 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
2194 {"return": {}}
2195 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2197 --- Test Backup #2 ---
2200 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2201 {"return": {}}
2204 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2205 {"return": {}}
2207 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
2208 {"return": {}}
2209 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
2210 {"return": {}}
2211 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2212 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2214   "bitmaps": {
2215     "device0": [
2216       {
2217         "busy": false,
2218         "count": 0,
2219         "granularity": 65536,
2220         "name": "bitmap0",
2221         "persistent": false,
2222         "recording": true,
2223         "status": "active"
2224       }
2225     ]
2226   }
2229 = Checking Bitmap bitmap0 =
2230 expecting 0 dirty sectors; have 0. OK!
2232 --- Cleanup ---
2234 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
2235 {"return": {}}
2237   "bitmaps": {
2238     "device0": []
2239   }
2242 --- Verification ---
2244 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
2245 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2246 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2249 === Mode full; Bitmap Sync on-success with simulated failure ===
2251 --- Preparing image & VM ---
2253 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
2254 {"return": {}}
2255 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
2256 {"return": {}}
2258 --- Write #0 ---
2260 write -P0x49 0x0000000 0x10000
2261 {"return": ""}
2262 write -P0x6c 0x0100000 0x10000
2263 {"return": ""}
2264 write -P0x6f 0x2000000 0x10000
2265 {"return": ""}
2266 write -P0x76 0x3ff0000 0x10000
2267 {"return": ""}
2269   "bitmaps": {
2270     "device0": []
2271   }
2274 --- Reference Backup #0 ---
2277 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2278 {"return": {}}
2281 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2282 {"return": {}}
2284 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
2285 {"return": {}}
2286 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2288 --- Add Bitmap ---
2290 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
2291 {"return": {}}
2293 --- Write #1 ---
2295 write -P0x65 0x0000000 0x10000
2296 {"return": ""}
2297 write -P0x77 0x00f8000 0x10000
2298 {"return": ""}
2299 write -P0x72 0x2008000 0x10000
2300 {"return": ""}
2301 write -P0x69 0x3fe0000 0x10000
2302 {"return": ""}
2304   "bitmaps": {
2305     "device0": [
2306       {
2307         "busy": false,
2308         "count": 393216,
2309         "granularity": 65536,
2310         "name": "bitmap0",
2311         "persistent": false,
2312         "recording": true,
2313         "status": "active"
2314       }
2315     ]
2316   }
2319 = Checking Bitmap bitmap0 =
2320 expecting 6 dirty sectors; have 6. OK!
2322 --- Reference Backup #1 ---
2325 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2326 {"return": {}}
2329 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2330 {"return": {}}
2332 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
2333 {"return": {}}
2334 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2336 --- Test Backup #1 ---
2339 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2340 {"return": {}}
2343 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2344 {"return": {}}
2346 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "full", "target": "backup_target_1"}}
2347 {"return": {}}
2349 --- Write #2 ---
2351 write -P0x74 0x0010000 0x10000
2352 {"return": ""}
2353 write -P0x69 0x00e8000 0x10000
2354 {"return": ""}
2355 write -P0x6e 0x2018000 0x10000
2356 {"return": ""}
2357 write -P0x67 0x3fe0000 0x20000
2358 {"return": ""}
2360   "bitmaps": {
2361     "device0": [
2362       {
2363         "busy": false,
2364         "count": 0,
2365         "granularity": 65536,
2366         "persistent": false,
2367         "recording": false,
2368         "status": "disabled"
2369       },
2370       {
2371         "busy": false,
2372         "count": 458752,
2373         "granularity": 65536,
2374         "persistent": false,
2375         "recording": true,
2376         "status": "active"
2377       },
2378       {
2379         "busy": true,
2380         "count": 393216,
2381         "granularity": 65536,
2382         "name": "bitmap0",
2383         "persistent": false,
2384         "recording": true,
2385         "status": "frozen"
2386       }
2387     ]
2388   }
2391 = Checking Bitmap bitmap0 =
2392 expecting 6 dirty sectors; have 6. OK!
2394 = Checking Bitmap (anonymous) =
2395 expecting 7 dirty sectors; have 7. OK!
2397 {"execute": "job-cancel", "arguments": {"id": "backup_1"}}
2398 {"return": {}}
2399 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2400 {"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2402   "bitmaps": {
2403     "device0": [
2404       {
2405         "busy": false,
2406         "count": 655360,
2407         "granularity": 65536,
2408         "name": "bitmap0",
2409         "persistent": false,
2410         "recording": true,
2411         "status": "active"
2412       }
2413     ]
2414   }
2417 = Checking Bitmap bitmap0 =
2418 expecting 10 dirty sectors; have 10. OK!
2420 --- Write #3 ---
2422 write -P0xaa 0x0010000 0x30000
2423 {"return": ""}
2424 write -P0xbb 0x00d8000 0x10000
2425 {"return": ""}
2426 write -P0xcc 0x2028000 0x10000
2427 {"return": ""}
2428 write -P0xdd 0x3fc0000 0x10000
2429 {"return": ""}
2431   "bitmaps": {
2432     "device0": [
2433       {
2434         "busy": false,
2435         "count": 983040,
2436         "granularity": 65536,
2437         "name": "bitmap0",
2438         "persistent": false,
2439         "recording": true,
2440         "status": "active"
2441       }
2442     ]
2443   }
2446 = Checking Bitmap bitmap0 =
2447 expecting 15 dirty sectors; have 15. OK!
2449 --- Reference Backup #2 ---
2452 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2453 {"return": {}}
2456 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2457 {"return": {}}
2459 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
2460 {"return": {}}
2461 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2463 --- Test Backup #2 ---
2466 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2467 {"return": {}}
2470 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2471 {"return": {}}
2473 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
2474 {"return": {}}
2475 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
2476 {"return": {}}
2477 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2478 {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2480   "bitmaps": {
2481     "device0": [
2482       {
2483         "busy": false,
2484         "count": 0,
2485         "granularity": 65536,
2486         "name": "bitmap0",
2487         "persistent": false,
2488         "recording": true,
2489         "status": "active"
2490       }
2491     ]
2492   }
2495 = Checking Bitmap bitmap0 =
2496 expecting 0 dirty sectors; have 0. OK!
2498 --- Cleanup ---
2500 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
2501 {"return": {}}
2503   "bitmaps": {
2504     "device0": []
2505   }
2508 --- Verification ---
2510 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
2511 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2512 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2515 === Mode full; Bitmap Sync on-success with intermediate failure ===
2517 --- Preparing image & VM ---
2519 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false, "once": true, "state": 3}], "set-state": [{"event": "flush_to_disk", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]}, "node-name": "drive0"}}
2520 {"return": {}}
2521 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
2522 {"return": {}}
2524 --- Write #0 ---
2526 write -P0x49 0x0000000 0x10000
2527 {"return": ""}
2528 write -P0x6c 0x0100000 0x10000
2529 {"return": ""}
2530 write -P0x6f 0x2000000 0x10000
2531 {"return": ""}
2532 write -P0x76 0x3ff0000 0x10000
2533 {"return": ""}
2535   "bitmaps": {
2536     "device0": []
2537   }
2540 --- Reference Backup #0 ---
2543 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2544 {"return": {}}
2547 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2548 {"return": {}}
2550 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
2551 {"return": {}}
2552 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2554 --- Add Bitmap ---
2556 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
2557 {"return": {}}
2559 --- Write #1 ---
2561 write -P0x65 0x0000000 0x10000
2562 {"return": ""}
2563 write -P0x77 0x00f8000 0x10000
2564 {"return": ""}
2565 write -P0x72 0x2008000 0x10000
2566 {"return": ""}
2567 write -P0x69 0x3fe0000 0x10000
2568 {"return": ""}
2570   "bitmaps": {
2571     "device0": [
2572       {
2573         "busy": false,
2574         "count": 393216,
2575         "granularity": 65536,
2576         "name": "bitmap0",
2577         "persistent": false,
2578         "recording": true,
2579         "status": "active"
2580       }
2581     ]
2582   }
2585 = Checking Bitmap bitmap0 =
2586 expecting 6 dirty sectors; have 6. OK!
2588 --- Reference Backup #1 ---
2591 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2592 {"return": {}}
2595 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2596 {"return": {}}
2598 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
2599 {"return": {}}
2600 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2602 {"return": ""}
2604 --- Test Backup #1 ---
2607 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2608 {"return": {}}
2611 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2612 {"return": {}}
2614 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "full", "target": "backup_target_1"}}
2615 {"return": {}}
2616 {"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2617 {"data": {"device": "backup_1", "error": "Input/output error", "len": 67108864, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2619   "bitmaps": {
2620     "device0": [
2621       {
2622         "busy": false,
2623         "count": 393216,
2624         "granularity": 65536,
2625         "name": "bitmap0",
2626         "persistent": false,
2627         "recording": true,
2628         "status": "active"
2629       }
2630     ]
2631   }
2634 = Checking Bitmap bitmap0 =
2635 expecting 6 dirty sectors; have 6. OK!
2637 --- Write #3 ---
2639 write -P0xaa 0x0010000 0x30000
2640 {"return": ""}
2641 write -P0xbb 0x00d8000 0x10000
2642 {"return": ""}
2643 write -P0xcc 0x2028000 0x10000
2644 {"return": ""}
2645 write -P0xdd 0x3fc0000 0x10000
2646 {"return": ""}
2648   "bitmaps": {
2649     "device0": [
2650       {
2651         "busy": false,
2652         "count": 917504,
2653         "granularity": 65536,
2654         "name": "bitmap0",
2655         "persistent": false,
2656         "recording": true,
2657         "status": "active"
2658       }
2659     ]
2660   }
2663 = Checking Bitmap bitmap0 =
2664 expecting 14 dirty sectors; have 14. OK!
2666 --- Reference Backup #2 ---
2669 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2670 {"return": {}}
2673 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2674 {"return": {}}
2676 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
2677 {"return": {}}
2678 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2680 --- Test Backup #2 ---
2683 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2684 {"return": {}}
2687 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2688 {"return": {}}
2690 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
2691 {"return": {}}
2692 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
2693 {"return": {}}
2694 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2695 {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2697   "bitmaps": {
2698     "device0": [
2699       {
2700         "busy": false,
2701         "count": 0,
2702         "granularity": 65536,
2703         "name": "bitmap0",
2704         "persistent": false,
2705         "recording": true,
2706         "status": "active"
2707       }
2708     ]
2709   }
2712 = Checking Bitmap bitmap0 =
2713 expecting 0 dirty sectors; have 0. OK!
2715 --- Cleanup ---
2717 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
2718 {"return": {}}
2720   "bitmaps": {
2721     "device0": []
2722   }
2725 --- Verification ---
2727 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
2728 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2729 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2732 === Mode full; Bitmap Sync on-success without failure ===
2734 --- Preparing image & VM ---
2736 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
2737 {"return": {}}
2738 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
2739 {"return": {}}
2741 --- Write #0 ---
2743 write -P0x49 0x0000000 0x10000
2744 {"return": ""}
2745 write -P0x6c 0x0100000 0x10000
2746 {"return": ""}
2747 write -P0x6f 0x2000000 0x10000
2748 {"return": ""}
2749 write -P0x76 0x3ff0000 0x10000
2750 {"return": ""}
2752   "bitmaps": {
2753     "device0": []
2754   }
2757 --- Reference Backup #0 ---
2760 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2761 {"return": {}}
2764 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2765 {"return": {}}
2767 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
2768 {"return": {}}
2769 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2771 --- Add Bitmap ---
2773 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
2774 {"return": {}}
2776 --- Write #1 ---
2778 write -P0x65 0x0000000 0x10000
2779 {"return": ""}
2780 write -P0x77 0x00f8000 0x10000
2781 {"return": ""}
2782 write -P0x72 0x2008000 0x10000
2783 {"return": ""}
2784 write -P0x69 0x3fe0000 0x10000
2785 {"return": ""}
2787   "bitmaps": {
2788     "device0": [
2789       {
2790         "busy": false,
2791         "count": 393216,
2792         "granularity": 65536,
2793         "name": "bitmap0",
2794         "persistent": false,
2795         "recording": true,
2796         "status": "active"
2797       }
2798     ]
2799   }
2802 = Checking Bitmap bitmap0 =
2803 expecting 6 dirty sectors; have 6. OK!
2805 --- Reference Backup #1 ---
2808 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2809 {"return": {}}
2812 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2813 {"return": {}}
2815 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
2816 {"return": {}}
2817 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2819 --- Test Backup #1 ---
2822 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2823 {"return": {}}
2826 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2827 {"return": {}}
2829 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "full", "target": "backup_target_1"}}
2830 {"return": {}}
2832 --- Write #2 ---
2834 write -P0x74 0x0010000 0x10000
2835 {"return": ""}
2836 write -P0x69 0x00e8000 0x10000
2837 {"return": ""}
2838 write -P0x6e 0x2018000 0x10000
2839 {"return": ""}
2840 write -P0x67 0x3fe0000 0x20000
2841 {"return": ""}
2843   "bitmaps": {
2844     "device0": [
2845       {
2846         "busy": false,
2847         "count": 0,
2848         "granularity": 65536,
2849         "persistent": false,
2850         "recording": false,
2851         "status": "disabled"
2852       },
2853       {
2854         "busy": false,
2855         "count": 458752,
2856         "granularity": 65536,
2857         "persistent": false,
2858         "recording": true,
2859         "status": "active"
2860       },
2861       {
2862         "busy": true,
2863         "count": 393216,
2864         "granularity": 65536,
2865         "name": "bitmap0",
2866         "persistent": false,
2867         "recording": true,
2868         "status": "frozen"
2869       }
2870     ]
2871   }
2874 = Checking Bitmap bitmap0 =
2875 expecting 6 dirty sectors; have 6. OK!
2877 = Checking Bitmap (anonymous) =
2878 expecting 7 dirty sectors; have 7. OK!
2880 {"execute": "job-finalize", "arguments": {"id": "backup_1"}}
2881 {"return": {}}
2882 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2883 {"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2885   "bitmaps": {
2886     "device0": [
2887       {
2888         "busy": false,
2889         "count": 458752,
2890         "granularity": 65536,
2891         "name": "bitmap0",
2892         "persistent": false,
2893         "recording": true,
2894         "status": "active"
2895       }
2896     ]
2897   }
2900 = Checking Bitmap bitmap0 =
2901 expecting 7 dirty sectors; have 7. OK!
2903 --- Write #3 ---
2905 write -P0xaa 0x0010000 0x30000
2906 {"return": ""}
2907 write -P0xbb 0x00d8000 0x10000
2908 {"return": ""}
2909 write -P0xcc 0x2028000 0x10000
2910 {"return": ""}
2911 write -P0xdd 0x3fc0000 0x10000
2912 {"return": ""}
2914   "bitmaps": {
2915     "device0": [
2916       {
2917         "busy": false,
2918         "count": 786432,
2919         "granularity": 65536,
2920         "name": "bitmap0",
2921         "persistent": false,
2922         "recording": true,
2923         "status": "active"
2924       }
2925     ]
2926   }
2929 = Checking Bitmap bitmap0 =
2930 expecting 12 dirty sectors; have 12. OK!
2932 --- Reference Backup #2 ---
2935 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2936 {"return": {}}
2939 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2940 {"return": {}}
2942 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
2943 {"return": {}}
2944 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2946 --- Test Backup #2 ---
2949 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
2950 {"return": {}}
2953 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
2954 {"return": {}}
2956 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
2957 {"return": {}}
2958 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
2959 {"return": {}}
2960 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2961 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
2963   "bitmaps": {
2964     "device0": [
2965       {
2966         "busy": false,
2967         "count": 0,
2968         "granularity": 65536,
2969         "name": "bitmap0",
2970         "persistent": false,
2971         "recording": true,
2972         "status": "active"
2973       }
2974     ]
2975   }
2978 = Checking Bitmap bitmap0 =
2979 expecting 0 dirty sectors; have 0. OK!
2981 --- Cleanup ---
2983 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
2984 {"return": {}}
2986   "bitmaps": {
2987     "device0": []
2988   }
2991 --- Verification ---
2993 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
2994 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2995 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
2998 === Mode full; Bitmap Sync always with simulated failure ===
3000 --- Preparing image & VM ---
3002 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
3003 {"return": {}}
3004 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
3005 {"return": {}}
3007 --- Write #0 ---
3009 write -P0x49 0x0000000 0x10000
3010 {"return": ""}
3011 write -P0x6c 0x0100000 0x10000
3012 {"return": ""}
3013 write -P0x6f 0x2000000 0x10000
3014 {"return": ""}
3015 write -P0x76 0x3ff0000 0x10000
3016 {"return": ""}
3018   "bitmaps": {
3019     "device0": []
3020   }
3023 --- Reference Backup #0 ---
3026 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3027 {"return": {}}
3030 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3031 {"return": {}}
3033 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
3034 {"return": {}}
3035 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3037 --- Add Bitmap ---
3039 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
3040 {"return": {}}
3042 --- Write #1 ---
3044 write -P0x65 0x0000000 0x10000
3045 {"return": ""}
3046 write -P0x77 0x00f8000 0x10000
3047 {"return": ""}
3048 write -P0x72 0x2008000 0x10000
3049 {"return": ""}
3050 write -P0x69 0x3fe0000 0x10000
3051 {"return": ""}
3053   "bitmaps": {
3054     "device0": [
3055       {
3056         "busy": false,
3057         "count": 393216,
3058         "granularity": 65536,
3059         "name": "bitmap0",
3060         "persistent": false,
3061         "recording": true,
3062         "status": "active"
3063       }
3064     ]
3065   }
3068 = Checking Bitmap bitmap0 =
3069 expecting 6 dirty sectors; have 6. OK!
3071 --- Reference Backup #1 ---
3074 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3075 {"return": {}}
3078 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3079 {"return": {}}
3081 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
3082 {"return": {}}
3083 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3085 --- Test Backup #1 ---
3088 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3089 {"return": {}}
3092 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3093 {"return": {}}
3095 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "full", "target": "backup_target_1"}}
3096 {"return": {}}
3098 --- Write #2 ---
3100 write -P0x74 0x0010000 0x10000
3101 {"return": ""}
3102 write -P0x69 0x00e8000 0x10000
3103 {"return": ""}
3104 write -P0x6e 0x2018000 0x10000
3105 {"return": ""}
3106 write -P0x67 0x3fe0000 0x20000
3107 {"return": ""}
3109   "bitmaps": {
3110     "device0": [
3111       {
3112         "busy": false,
3113         "count": 0,
3114         "granularity": 65536,
3115         "persistent": false,
3116         "recording": false,
3117         "status": "disabled"
3118       },
3119       {
3120         "busy": false,
3121         "count": 458752,
3122         "granularity": 65536,
3123         "persistent": false,
3124         "recording": true,
3125         "status": "active"
3126       },
3127       {
3128         "busy": true,
3129         "count": 393216,
3130         "granularity": 65536,
3131         "name": "bitmap0",
3132         "persistent": false,
3133         "recording": true,
3134         "status": "frozen"
3135       }
3136     ]
3137   }
3140 = Checking Bitmap bitmap0 =
3141 expecting 6 dirty sectors; have 6. OK!
3143 = Checking Bitmap (anonymous) =
3144 expecting 7 dirty sectors; have 7. OK!
3146 {"execute": "job-cancel", "arguments": {"id": "backup_1"}}
3147 {"return": {}}
3148 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3149 {"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3151   "bitmaps": {
3152     "device0": [
3153       {
3154         "busy": false,
3155         "count": 458752,
3156         "granularity": 65536,
3157         "name": "bitmap0",
3158         "persistent": false,
3159         "recording": true,
3160         "status": "active"
3161       }
3162     ]
3163   }
3166 = Checking Bitmap bitmap0 =
3167 expecting 7 dirty sectors; have 7. OK!
3169 --- Write #3 ---
3171 write -P0xaa 0x0010000 0x30000
3172 {"return": ""}
3173 write -P0xbb 0x00d8000 0x10000
3174 {"return": ""}
3175 write -P0xcc 0x2028000 0x10000
3176 {"return": ""}
3177 write -P0xdd 0x3fc0000 0x10000
3178 {"return": ""}
3180   "bitmaps": {
3181     "device0": [
3182       {
3183         "busy": false,
3184         "count": 786432,
3185         "granularity": 65536,
3186         "name": "bitmap0",
3187         "persistent": false,
3188         "recording": true,
3189         "status": "active"
3190       }
3191     ]
3192   }
3195 = Checking Bitmap bitmap0 =
3196 expecting 12 dirty sectors; have 12. OK!
3198 --- Reference Backup #2 ---
3201 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3202 {"return": {}}
3205 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3206 {"return": {}}
3208 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
3209 {"return": {}}
3210 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3212 --- Test Backup #2 ---
3215 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3216 {"return": {}}
3219 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3220 {"return": {}}
3222 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
3223 {"return": {}}
3224 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
3225 {"return": {}}
3226 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3227 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3229   "bitmaps": {
3230     "device0": [
3231       {
3232         "busy": false,
3233         "count": 0,
3234         "granularity": 65536,
3235         "name": "bitmap0",
3236         "persistent": false,
3237         "recording": true,
3238         "status": "active"
3239       }
3240     ]
3241   }
3244 = Checking Bitmap bitmap0 =
3245 expecting 0 dirty sectors; have 0. OK!
3247 --- Cleanup ---
3249 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
3250 {"return": {}}
3252   "bitmaps": {
3253     "device0": []
3254   }
3257 --- Verification ---
3259 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
3260 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
3261 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
3264 === Mode full; Bitmap Sync always with intermediate failure ===
3266 --- Preparing image & VM ---
3268 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false, "once": true, "state": 3}], "set-state": [{"event": "flush_to_disk", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]}, "node-name": "drive0"}}
3269 {"return": {}}
3270 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
3271 {"return": {}}
3273 --- Write #0 ---
3275 write -P0x49 0x0000000 0x10000
3276 {"return": ""}
3277 write -P0x6c 0x0100000 0x10000
3278 {"return": ""}
3279 write -P0x6f 0x2000000 0x10000
3280 {"return": ""}
3281 write -P0x76 0x3ff0000 0x10000
3282 {"return": ""}
3284   "bitmaps": {
3285     "device0": []
3286   }
3289 --- Reference Backup #0 ---
3292 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3293 {"return": {}}
3296 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3297 {"return": {}}
3299 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
3300 {"return": {}}
3301 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3303 --- Add Bitmap ---
3305 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
3306 {"return": {}}
3308 --- Write #1 ---
3310 write -P0x65 0x0000000 0x10000
3311 {"return": ""}
3312 write -P0x77 0x00f8000 0x10000
3313 {"return": ""}
3314 write -P0x72 0x2008000 0x10000
3315 {"return": ""}
3316 write -P0x69 0x3fe0000 0x10000
3317 {"return": ""}
3319   "bitmaps": {
3320     "device0": [
3321       {
3322         "busy": false,
3323         "count": 393216,
3324         "granularity": 65536,
3325         "name": "bitmap0",
3326         "persistent": false,
3327         "recording": true,
3328         "status": "active"
3329       }
3330     ]
3331   }
3334 = Checking Bitmap bitmap0 =
3335 expecting 6 dirty sectors; have 6. OK!
3337 --- Reference Backup #1 ---
3340 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3341 {"return": {}}
3344 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3345 {"return": {}}
3347 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
3348 {"return": {}}
3349 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3351 {"return": ""}
3353 --- Test Backup #1 ---
3356 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3357 {"return": {}}
3360 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3361 {"return": {}}
3363 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "full", "target": "backup_target_1"}}
3364 {"return": {}}
3365 {"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3366 {"data": {"device": "backup_1", "error": "Input/output error", "len": 67108864, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3368   "bitmaps": {
3369     "device0": [
3370       {
3371         "busy": false,
3372         "count": 66125824,
3373         "granularity": 65536,
3374         "name": "bitmap0",
3375         "persistent": false,
3376         "recording": true,
3377         "status": "active"
3378       }
3379     ]
3380   }
3383 = Checking Bitmap bitmap0 =
3384 expecting 1009 dirty sectors; have 1009. OK!
3386 --- Write #3 ---
3388 write -P0xaa 0x0010000 0x30000
3389 {"return": ""}
3390 write -P0xbb 0x00d8000 0x10000
3391 {"return": ""}
3392 write -P0xcc 0x2028000 0x10000
3393 {"return": ""}
3394 write -P0xdd 0x3fc0000 0x10000
3395 {"return": ""}
3397   "bitmaps": {
3398     "device0": [
3399       {
3400         "busy": false,
3401         "count": 66453504,
3402         "granularity": 65536,
3403         "name": "bitmap0",
3404         "persistent": false,
3405         "recording": true,
3406         "status": "active"
3407       }
3408     ]
3409   }
3412 = Checking Bitmap bitmap0 =
3413 expecting 1014 dirty sectors; have 1014. OK!
3415 --- Reference Backup #2 ---
3418 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3419 {"return": {}}
3422 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3423 {"return": {}}
3425 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
3426 {"return": {}}
3427 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3429 --- Test Backup #2 ---
3432 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3433 {"return": {}}
3436 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3437 {"return": {}}
3439 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
3440 {"return": {}}
3441 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
3442 {"return": {}}
3443 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3444 {"data": {"device": "backup_2", "len": 66453504, "offset": 66453504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3446   "bitmaps": {
3447     "device0": [
3448       {
3449         "busy": false,
3450         "count": 0,
3451         "granularity": 65536,
3452         "name": "bitmap0",
3453         "persistent": false,
3454         "recording": true,
3455         "status": "active"
3456       }
3457     ]
3458   }
3461 = Checking Bitmap bitmap0 =
3462 expecting 0 dirty sectors; have 0. OK!
3464 --- Cleanup ---
3466 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
3467 {"return": {}}
3469   "bitmaps": {
3470     "device0": []
3471   }
3474 --- Verification ---
3476 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
3477 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
3478 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
3481 === Mode full; Bitmap Sync always without failure ===
3483 --- Preparing image & VM ---
3485 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
3486 {"return": {}}
3487 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
3488 {"return": {}}
3490 --- Write #0 ---
3492 write -P0x49 0x0000000 0x10000
3493 {"return": ""}
3494 write -P0x6c 0x0100000 0x10000
3495 {"return": ""}
3496 write -P0x6f 0x2000000 0x10000
3497 {"return": ""}
3498 write -P0x76 0x3ff0000 0x10000
3499 {"return": ""}
3501   "bitmaps": {
3502     "device0": []
3503   }
3506 --- Reference Backup #0 ---
3509 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3510 {"return": {}}
3513 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3514 {"return": {}}
3516 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
3517 {"return": {}}
3518 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3520 --- Add Bitmap ---
3522 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
3523 {"return": {}}
3525 --- Write #1 ---
3527 write -P0x65 0x0000000 0x10000
3528 {"return": ""}
3529 write -P0x77 0x00f8000 0x10000
3530 {"return": ""}
3531 write -P0x72 0x2008000 0x10000
3532 {"return": ""}
3533 write -P0x69 0x3fe0000 0x10000
3534 {"return": ""}
3536   "bitmaps": {
3537     "device0": [
3538       {
3539         "busy": false,
3540         "count": 393216,
3541         "granularity": 65536,
3542         "name": "bitmap0",
3543         "persistent": false,
3544         "recording": true,
3545         "status": "active"
3546       }
3547     ]
3548   }
3551 = Checking Bitmap bitmap0 =
3552 expecting 6 dirty sectors; have 6. OK!
3554 --- Reference Backup #1 ---
3557 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3558 {"return": {}}
3561 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3562 {"return": {}}
3564 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
3565 {"return": {}}
3566 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3568 --- Test Backup #1 ---
3571 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3572 {"return": {}}
3575 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3576 {"return": {}}
3578 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "full", "target": "backup_target_1"}}
3579 {"return": {}}
3581 --- Write #2 ---
3583 write -P0x74 0x0010000 0x10000
3584 {"return": ""}
3585 write -P0x69 0x00e8000 0x10000
3586 {"return": ""}
3587 write -P0x6e 0x2018000 0x10000
3588 {"return": ""}
3589 write -P0x67 0x3fe0000 0x20000
3590 {"return": ""}
3592   "bitmaps": {
3593     "device0": [
3594       {
3595         "busy": false,
3596         "count": 0,
3597         "granularity": 65536,
3598         "persistent": false,
3599         "recording": false,
3600         "status": "disabled"
3601       },
3602       {
3603         "busy": false,
3604         "count": 458752,
3605         "granularity": 65536,
3606         "persistent": false,
3607         "recording": true,
3608         "status": "active"
3609       },
3610       {
3611         "busy": true,
3612         "count": 393216,
3613         "granularity": 65536,
3614         "name": "bitmap0",
3615         "persistent": false,
3616         "recording": true,
3617         "status": "frozen"
3618       }
3619     ]
3620   }
3623 = Checking Bitmap bitmap0 =
3624 expecting 6 dirty sectors; have 6. OK!
3626 = Checking Bitmap (anonymous) =
3627 expecting 7 dirty sectors; have 7. OK!
3629 {"execute": "job-finalize", "arguments": {"id": "backup_1"}}
3630 {"return": {}}
3631 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3632 {"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3634   "bitmaps": {
3635     "device0": [
3636       {
3637         "busy": false,
3638         "count": 458752,
3639         "granularity": 65536,
3640         "name": "bitmap0",
3641         "persistent": false,
3642         "recording": true,
3643         "status": "active"
3644       }
3645     ]
3646   }
3649 = Checking Bitmap bitmap0 =
3650 expecting 7 dirty sectors; have 7. OK!
3652 --- Write #3 ---
3654 write -P0xaa 0x0010000 0x30000
3655 {"return": ""}
3656 write -P0xbb 0x00d8000 0x10000
3657 {"return": ""}
3658 write -P0xcc 0x2028000 0x10000
3659 {"return": ""}
3660 write -P0xdd 0x3fc0000 0x10000
3661 {"return": ""}
3663   "bitmaps": {
3664     "device0": [
3665       {
3666         "busy": false,
3667         "count": 786432,
3668         "granularity": 65536,
3669         "name": "bitmap0",
3670         "persistent": false,
3671         "recording": true,
3672         "status": "active"
3673       }
3674     ]
3675   }
3678 = Checking Bitmap bitmap0 =
3679 expecting 12 dirty sectors; have 12. OK!
3681 --- Reference Backup #2 ---
3684 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3685 {"return": {}}
3688 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3689 {"return": {}}
3691 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
3692 {"return": {}}
3693 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3695 --- Test Backup #2 ---
3698 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3699 {"return": {}}
3702 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3703 {"return": {}}
3705 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
3706 {"return": {}}
3707 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
3708 {"return": {}}
3709 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3710 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3712   "bitmaps": {
3713     "device0": [
3714       {
3715         "busy": false,
3716         "count": 0,
3717         "granularity": 65536,
3718         "name": "bitmap0",
3719         "persistent": false,
3720         "recording": true,
3721         "status": "active"
3722       }
3723     ]
3724   }
3727 = Checking Bitmap bitmap0 =
3728 expecting 0 dirty sectors; have 0. OK!
3730 --- Cleanup ---
3732 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
3733 {"return": {}}
3735   "bitmaps": {
3736     "device0": []
3737   }
3740 --- Verification ---
3742 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
3743 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
3744 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
3747 === Mode top; Bitmap Sync on-success with simulated failure ===
3749 --- Preparing image & VM ---
3751 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
3752 {"return": {}}
3753 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
3754 {"return": {}}
3756 --- Write #0 ---
3758 write -P0x49 0x0000000 0x10000
3759 {"return": ""}
3760 write -P0x6c 0x0100000 0x10000
3761 {"return": ""}
3762 write -P0x6f 0x2000000 0x10000
3763 {"return": ""}
3764 write -P0x76 0x3ff0000 0x10000
3765 {"return": ""}
3767   "bitmaps": {
3768     "device0": []
3769   }
3772 --- Reference Backup #0 ---
3775 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3776 {"return": {}}
3779 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3780 {"return": {}}
3782 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
3783 {"return": {}}
3784 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3786 --- Add Bitmap ---
3788 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
3789 {"return": {}}
3791 --- Write #1 ---
3793 write -P0x65 0x0000000 0x10000
3794 {"return": ""}
3795 write -P0x77 0x00f8000 0x10000
3796 {"return": ""}
3797 write -P0x72 0x2008000 0x10000
3798 {"return": ""}
3799 write -P0x69 0x3fe0000 0x10000
3800 {"return": ""}
3802   "bitmaps": {
3803     "device0": [
3804       {
3805         "busy": false,
3806         "count": 393216,
3807         "granularity": 65536,
3808         "name": "bitmap0",
3809         "persistent": false,
3810         "recording": true,
3811         "status": "active"
3812       }
3813     ]
3814   }
3817 = Checking Bitmap bitmap0 =
3818 expecting 6 dirty sectors; have 6. OK!
3820 --- Reference Backup #1 ---
3823 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3824 {"return": {}}
3827 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3828 {"return": {}}
3830 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
3831 {"return": {}}
3832 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3834 --- Test Backup #1 ---
3837 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3838 {"return": {}}
3841 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3842 {"return": {}}
3844 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "top", "target": "backup_target_1"}}
3845 {"return": {}}
3847 --- Write #2 ---
3849 write -P0x74 0x0010000 0x10000
3850 {"return": ""}
3851 write -P0x69 0x00e8000 0x10000
3852 {"return": ""}
3853 write -P0x6e 0x2018000 0x10000
3854 {"return": ""}
3855 write -P0x67 0x3fe0000 0x20000
3856 {"return": ""}
3858   "bitmaps": {
3859     "device0": [
3860       {
3861         "busy": false,
3862         "count": 0,
3863         "granularity": 65536,
3864         "persistent": false,
3865         "recording": false,
3866         "status": "disabled"
3867       },
3868       {
3869         "busy": false,
3870         "count": 458752,
3871         "granularity": 65536,
3872         "persistent": false,
3873         "recording": true,
3874         "status": "active"
3875       },
3876       {
3877         "busy": true,
3878         "count": 393216,
3879         "granularity": 65536,
3880         "name": "bitmap0",
3881         "persistent": false,
3882         "recording": true,
3883         "status": "frozen"
3884       }
3885     ]
3886   }
3889 = Checking Bitmap bitmap0 =
3890 expecting 6 dirty sectors; have 6. OK!
3892 = Checking Bitmap (anonymous) =
3893 expecting 7 dirty sectors; have 7. OK!
3895 {"execute": "job-cancel", "arguments": {"id": "backup_1"}}
3896 {"return": {}}
3897 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3898 {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3900   "bitmaps": {
3901     "device0": [
3902       {
3903         "busy": false,
3904         "count": 655360,
3905         "granularity": 65536,
3906         "name": "bitmap0",
3907         "persistent": false,
3908         "recording": true,
3909         "status": "active"
3910       }
3911     ]
3912   }
3915 = Checking Bitmap bitmap0 =
3916 expecting 10 dirty sectors; have 10. OK!
3918 --- Write #3 ---
3920 write -P0xaa 0x0010000 0x30000
3921 {"return": ""}
3922 write -P0xbb 0x00d8000 0x10000
3923 {"return": ""}
3924 write -P0xcc 0x2028000 0x10000
3925 {"return": ""}
3926 write -P0xdd 0x3fc0000 0x10000
3927 {"return": ""}
3929   "bitmaps": {
3930     "device0": [
3931       {
3932         "busy": false,
3933         "count": 983040,
3934         "granularity": 65536,
3935         "name": "bitmap0",
3936         "persistent": false,
3937         "recording": true,
3938         "status": "active"
3939       }
3940     ]
3941   }
3944 = Checking Bitmap bitmap0 =
3945 expecting 15 dirty sectors; have 15. OK!
3947 --- Reference Backup #2 ---
3950 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3951 {"return": {}}
3954 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3955 {"return": {}}
3957 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
3958 {"return": {}}
3959 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3961 --- Test Backup #2 ---
3964 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
3965 {"return": {}}
3968 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
3969 {"return": {}}
3971 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
3972 {"return": {}}
3973 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
3974 {"return": {}}
3975 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3976 {"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
3978   "bitmaps": {
3979     "device0": [
3980       {
3981         "busy": false,
3982         "count": 0,
3983         "granularity": 65536,
3984         "name": "bitmap0",
3985         "persistent": false,
3986         "recording": true,
3987         "status": "active"
3988       }
3989     ]
3990   }
3993 = Checking Bitmap bitmap0 =
3994 expecting 0 dirty sectors; have 0. OK!
3996 --- Cleanup ---
3998 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
3999 {"return": {}}
4001   "bitmaps": {
4002     "device0": []
4003   }
4006 --- Verification ---
4008 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
4009 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4010 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4013 === Mode top; Bitmap Sync on-success with intermediate failure ===
4015 --- Preparing image & VM ---
4017 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false, "once": true, "state": 3}], "set-state": [{"event": "flush_to_disk", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]}, "node-name": "drive0"}}
4018 {"return": {}}
4019 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
4020 {"return": {}}
4022 --- Write #0 ---
4024 write -P0x49 0x0000000 0x10000
4025 {"return": ""}
4026 write -P0x6c 0x0100000 0x10000
4027 {"return": ""}
4028 write -P0x6f 0x2000000 0x10000
4029 {"return": ""}
4030 write -P0x76 0x3ff0000 0x10000
4031 {"return": ""}
4033   "bitmaps": {
4034     "device0": []
4035   }
4038 --- Reference Backup #0 ---
4041 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4042 {"return": {}}
4045 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4046 {"return": {}}
4048 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
4049 {"return": {}}
4050 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4052 --- Add Bitmap ---
4054 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
4055 {"return": {}}
4057 --- Write #1 ---
4059 write -P0x65 0x0000000 0x10000
4060 {"return": ""}
4061 write -P0x77 0x00f8000 0x10000
4062 {"return": ""}
4063 write -P0x72 0x2008000 0x10000
4064 {"return": ""}
4065 write -P0x69 0x3fe0000 0x10000
4066 {"return": ""}
4068   "bitmaps": {
4069     "device0": [
4070       {
4071         "busy": false,
4072         "count": 393216,
4073         "granularity": 65536,
4074         "name": "bitmap0",
4075         "persistent": false,
4076         "recording": true,
4077         "status": "active"
4078       }
4079     ]
4080   }
4083 = Checking Bitmap bitmap0 =
4084 expecting 6 dirty sectors; have 6. OK!
4086 --- Reference Backup #1 ---
4089 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4090 {"return": {}}
4093 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4094 {"return": {}}
4096 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
4097 {"return": {}}
4098 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4100 {"return": ""}
4102 --- Test Backup #1 ---
4105 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4106 {"return": {}}
4109 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4110 {"return": {}}
4112 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "top", "target": "backup_target_1"}}
4113 {"return": {}}
4114 {"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4115 {"data": {"device": "backup_1", "error": "Input/output error", "len": 458752, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4117   "bitmaps": {
4118     "device0": [
4119       {
4120         "busy": false,
4121         "count": 393216,
4122         "granularity": 65536,
4123         "name": "bitmap0",
4124         "persistent": false,
4125         "recording": true,
4126         "status": "active"
4127       }
4128     ]
4129   }
4132 = Checking Bitmap bitmap0 =
4133 expecting 6 dirty sectors; have 6. OK!
4135 --- Write #3 ---
4137 write -P0xaa 0x0010000 0x30000
4138 {"return": ""}
4139 write -P0xbb 0x00d8000 0x10000
4140 {"return": ""}
4141 write -P0xcc 0x2028000 0x10000
4142 {"return": ""}
4143 write -P0xdd 0x3fc0000 0x10000
4144 {"return": ""}
4146   "bitmaps": {
4147     "device0": [
4148       {
4149         "busy": false,
4150         "count": 917504,
4151         "granularity": 65536,
4152         "name": "bitmap0",
4153         "persistent": false,
4154         "recording": true,
4155         "status": "active"
4156       }
4157     ]
4158   }
4161 = Checking Bitmap bitmap0 =
4162 expecting 14 dirty sectors; have 14. OK!
4164 --- Reference Backup #2 ---
4167 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4168 {"return": {}}
4171 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4172 {"return": {}}
4174 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
4175 {"return": {}}
4176 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4178 --- Test Backup #2 ---
4181 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4182 {"return": {}}
4185 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4186 {"return": {}}
4188 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
4189 {"return": {}}
4190 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
4191 {"return": {}}
4192 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4193 {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4195   "bitmaps": {
4196     "device0": [
4197       {
4198         "busy": false,
4199         "count": 0,
4200         "granularity": 65536,
4201         "name": "bitmap0",
4202         "persistent": false,
4203         "recording": true,
4204         "status": "active"
4205       }
4206     ]
4207   }
4210 = Checking Bitmap bitmap0 =
4211 expecting 0 dirty sectors; have 0. OK!
4213 --- Cleanup ---
4215 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
4216 {"return": {}}
4218   "bitmaps": {
4219     "device0": []
4220   }
4223 --- Verification ---
4225 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
4226 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4227 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4230 === Mode top; Bitmap Sync on-success without failure ===
4232 --- Preparing image & VM ---
4234 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
4235 {"return": {}}
4236 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
4237 {"return": {}}
4239 --- Write #0 ---
4241 write -P0x49 0x0000000 0x10000
4242 {"return": ""}
4243 write -P0x6c 0x0100000 0x10000
4244 {"return": ""}
4245 write -P0x6f 0x2000000 0x10000
4246 {"return": ""}
4247 write -P0x76 0x3ff0000 0x10000
4248 {"return": ""}
4250   "bitmaps": {
4251     "device0": []
4252   }
4255 --- Reference Backup #0 ---
4258 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4259 {"return": {}}
4262 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4263 {"return": {}}
4265 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
4266 {"return": {}}
4267 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4269 --- Add Bitmap ---
4271 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
4272 {"return": {}}
4274 --- Write #1 ---
4276 write -P0x65 0x0000000 0x10000
4277 {"return": ""}
4278 write -P0x77 0x00f8000 0x10000
4279 {"return": ""}
4280 write -P0x72 0x2008000 0x10000
4281 {"return": ""}
4282 write -P0x69 0x3fe0000 0x10000
4283 {"return": ""}
4285   "bitmaps": {
4286     "device0": [
4287       {
4288         "busy": false,
4289         "count": 393216,
4290         "granularity": 65536,
4291         "name": "bitmap0",
4292         "persistent": false,
4293         "recording": true,
4294         "status": "active"
4295       }
4296     ]
4297   }
4300 = Checking Bitmap bitmap0 =
4301 expecting 6 dirty sectors; have 6. OK!
4303 --- Reference Backup #1 ---
4306 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4307 {"return": {}}
4310 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4311 {"return": {}}
4313 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
4314 {"return": {}}
4315 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4317 --- Test Backup #1 ---
4320 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4321 {"return": {}}
4324 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4325 {"return": {}}
4327 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_1", "sync": "top", "target": "backup_target_1"}}
4328 {"return": {}}
4330 --- Write #2 ---
4332 write -P0x74 0x0010000 0x10000
4333 {"return": ""}
4334 write -P0x69 0x00e8000 0x10000
4335 {"return": ""}
4336 write -P0x6e 0x2018000 0x10000
4337 {"return": ""}
4338 write -P0x67 0x3fe0000 0x20000
4339 {"return": ""}
4341   "bitmaps": {
4342     "device0": [
4343       {
4344         "busy": false,
4345         "count": 0,
4346         "granularity": 65536,
4347         "persistent": false,
4348         "recording": false,
4349         "status": "disabled"
4350       },
4351       {
4352         "busy": false,
4353         "count": 458752,
4354         "granularity": 65536,
4355         "persistent": false,
4356         "recording": true,
4357         "status": "active"
4358       },
4359       {
4360         "busy": true,
4361         "count": 393216,
4362         "granularity": 65536,
4363         "name": "bitmap0",
4364         "persistent": false,
4365         "recording": true,
4366         "status": "frozen"
4367       }
4368     ]
4369   }
4372 = Checking Bitmap bitmap0 =
4373 expecting 6 dirty sectors; have 6. OK!
4375 = Checking Bitmap (anonymous) =
4376 expecting 7 dirty sectors; have 7. OK!
4378 {"execute": "job-finalize", "arguments": {"id": "backup_1"}}
4379 {"return": {}}
4380 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4381 {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4383   "bitmaps": {
4384     "device0": [
4385       {
4386         "busy": false,
4387         "count": 458752,
4388         "granularity": 65536,
4389         "name": "bitmap0",
4390         "persistent": false,
4391         "recording": true,
4392         "status": "active"
4393       }
4394     ]
4395   }
4398 = Checking Bitmap bitmap0 =
4399 expecting 7 dirty sectors; have 7. OK!
4401 --- Write #3 ---
4403 write -P0xaa 0x0010000 0x30000
4404 {"return": ""}
4405 write -P0xbb 0x00d8000 0x10000
4406 {"return": ""}
4407 write -P0xcc 0x2028000 0x10000
4408 {"return": ""}
4409 write -P0xdd 0x3fc0000 0x10000
4410 {"return": ""}
4412   "bitmaps": {
4413     "device0": [
4414       {
4415         "busy": false,
4416         "count": 786432,
4417         "granularity": 65536,
4418         "name": "bitmap0",
4419         "persistent": false,
4420         "recording": true,
4421         "status": "active"
4422       }
4423     ]
4424   }
4427 = Checking Bitmap bitmap0 =
4428 expecting 12 dirty sectors; have 12. OK!
4430 --- Reference Backup #2 ---
4433 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4434 {"return": {}}
4437 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4438 {"return": {}}
4440 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
4441 {"return": {}}
4442 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4444 --- Test Backup #2 ---
4447 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4448 {"return": {}}
4451 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4452 {"return": {}}
4454 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
4455 {"return": {}}
4456 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
4457 {"return": {}}
4458 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4459 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4461   "bitmaps": {
4462     "device0": [
4463       {
4464         "busy": false,
4465         "count": 0,
4466         "granularity": 65536,
4467         "name": "bitmap0",
4468         "persistent": false,
4469         "recording": true,
4470         "status": "active"
4471       }
4472     ]
4473   }
4476 = Checking Bitmap bitmap0 =
4477 expecting 0 dirty sectors; have 0. OK!
4479 --- Cleanup ---
4481 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
4482 {"return": {}}
4484   "bitmaps": {
4485     "device0": []
4486   }
4489 --- Verification ---
4491 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
4492 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4493 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4496 === Mode top; Bitmap Sync always with simulated failure ===
4498 --- Preparing image & VM ---
4500 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
4501 {"return": {}}
4502 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
4503 {"return": {}}
4505 --- Write #0 ---
4507 write -P0x49 0x0000000 0x10000
4508 {"return": ""}
4509 write -P0x6c 0x0100000 0x10000
4510 {"return": ""}
4511 write -P0x6f 0x2000000 0x10000
4512 {"return": ""}
4513 write -P0x76 0x3ff0000 0x10000
4514 {"return": ""}
4516   "bitmaps": {
4517     "device0": []
4518   }
4521 --- Reference Backup #0 ---
4524 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4525 {"return": {}}
4528 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4529 {"return": {}}
4531 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
4532 {"return": {}}
4533 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4535 --- Add Bitmap ---
4537 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
4538 {"return": {}}
4540 --- Write #1 ---
4542 write -P0x65 0x0000000 0x10000
4543 {"return": ""}
4544 write -P0x77 0x00f8000 0x10000
4545 {"return": ""}
4546 write -P0x72 0x2008000 0x10000
4547 {"return": ""}
4548 write -P0x69 0x3fe0000 0x10000
4549 {"return": ""}
4551   "bitmaps": {
4552     "device0": [
4553       {
4554         "busy": false,
4555         "count": 393216,
4556         "granularity": 65536,
4557         "name": "bitmap0",
4558         "persistent": false,
4559         "recording": true,
4560         "status": "active"
4561       }
4562     ]
4563   }
4566 = Checking Bitmap bitmap0 =
4567 expecting 6 dirty sectors; have 6. OK!
4569 --- Reference Backup #1 ---
4572 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4573 {"return": {}}
4576 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4577 {"return": {}}
4579 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
4580 {"return": {}}
4581 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4583 --- Test Backup #1 ---
4586 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4587 {"return": {}}
4590 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4591 {"return": {}}
4593 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "top", "target": "backup_target_1"}}
4594 {"return": {}}
4596 --- Write #2 ---
4598 write -P0x74 0x0010000 0x10000
4599 {"return": ""}
4600 write -P0x69 0x00e8000 0x10000
4601 {"return": ""}
4602 write -P0x6e 0x2018000 0x10000
4603 {"return": ""}
4604 write -P0x67 0x3fe0000 0x20000
4605 {"return": ""}
4607   "bitmaps": {
4608     "device0": [
4609       {
4610         "busy": false,
4611         "count": 0,
4612         "granularity": 65536,
4613         "persistent": false,
4614         "recording": false,
4615         "status": "disabled"
4616       },
4617       {
4618         "busy": false,
4619         "count": 458752,
4620         "granularity": 65536,
4621         "persistent": false,
4622         "recording": true,
4623         "status": "active"
4624       },
4625       {
4626         "busy": true,
4627         "count": 393216,
4628         "granularity": 65536,
4629         "name": "bitmap0",
4630         "persistent": false,
4631         "recording": true,
4632         "status": "frozen"
4633       }
4634     ]
4635   }
4638 = Checking Bitmap bitmap0 =
4639 expecting 6 dirty sectors; have 6. OK!
4641 = Checking Bitmap (anonymous) =
4642 expecting 7 dirty sectors; have 7. OK!
4644 {"execute": "job-cancel", "arguments": {"id": "backup_1"}}
4645 {"return": {}}
4646 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4647 {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4649   "bitmaps": {
4650     "device0": [
4651       {
4652         "busy": false,
4653         "count": 458752,
4654         "granularity": 65536,
4655         "name": "bitmap0",
4656         "persistent": false,
4657         "recording": true,
4658         "status": "active"
4659       }
4660     ]
4661   }
4664 = Checking Bitmap bitmap0 =
4665 expecting 7 dirty sectors; have 7. OK!
4667 --- Write #3 ---
4669 write -P0xaa 0x0010000 0x30000
4670 {"return": ""}
4671 write -P0xbb 0x00d8000 0x10000
4672 {"return": ""}
4673 write -P0xcc 0x2028000 0x10000
4674 {"return": ""}
4675 write -P0xdd 0x3fc0000 0x10000
4676 {"return": ""}
4678   "bitmaps": {
4679     "device0": [
4680       {
4681         "busy": false,
4682         "count": 786432,
4683         "granularity": 65536,
4684         "name": "bitmap0",
4685         "persistent": false,
4686         "recording": true,
4687         "status": "active"
4688       }
4689     ]
4690   }
4693 = Checking Bitmap bitmap0 =
4694 expecting 12 dirty sectors; have 12. OK!
4696 --- Reference Backup #2 ---
4699 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4700 {"return": {}}
4703 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4704 {"return": {}}
4706 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
4707 {"return": {}}
4708 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4710 --- Test Backup #2 ---
4713 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4714 {"return": {}}
4717 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4718 {"return": {}}
4720 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
4721 {"return": {}}
4722 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
4723 {"return": {}}
4724 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4725 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4727   "bitmaps": {
4728     "device0": [
4729       {
4730         "busy": false,
4731         "count": 0,
4732         "granularity": 65536,
4733         "name": "bitmap0",
4734         "persistent": false,
4735         "recording": true,
4736         "status": "active"
4737       }
4738     ]
4739   }
4742 = Checking Bitmap bitmap0 =
4743 expecting 0 dirty sectors; have 0. OK!
4745 --- Cleanup ---
4747 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
4748 {"return": {}}
4750   "bitmaps": {
4751     "device0": []
4752   }
4755 --- Verification ---
4757 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
4758 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4759 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4762 === Mode top; Bitmap Sync always with intermediate failure ===
4764 --- Preparing image & VM ---
4766 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "blkdebug", "image": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "inject-error": [{"errno": 5, "event": "read_aio", "immediately": false, "once": true, "state": 3}], "set-state": [{"event": "flush_to_disk", "new-state": 2, "state": 1}, {"event": "read_aio", "new-state": 3, "state": 2}]}, "node-name": "drive0"}}
4767 {"return": {}}
4768 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
4769 {"return": {}}
4771 --- Write #0 ---
4773 write -P0x49 0x0000000 0x10000
4774 {"return": ""}
4775 write -P0x6c 0x0100000 0x10000
4776 {"return": ""}
4777 write -P0x6f 0x2000000 0x10000
4778 {"return": ""}
4779 write -P0x76 0x3ff0000 0x10000
4780 {"return": ""}
4782   "bitmaps": {
4783     "device0": []
4784   }
4787 --- Reference Backup #0 ---
4790 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4791 {"return": {}}
4794 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4795 {"return": {}}
4797 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
4798 {"return": {}}
4799 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4801 --- Add Bitmap ---
4803 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
4804 {"return": {}}
4806 --- Write #1 ---
4808 write -P0x65 0x0000000 0x10000
4809 {"return": ""}
4810 write -P0x77 0x00f8000 0x10000
4811 {"return": ""}
4812 write -P0x72 0x2008000 0x10000
4813 {"return": ""}
4814 write -P0x69 0x3fe0000 0x10000
4815 {"return": ""}
4817   "bitmaps": {
4818     "device0": [
4819       {
4820         "busy": false,
4821         "count": 393216,
4822         "granularity": 65536,
4823         "name": "bitmap0",
4824         "persistent": false,
4825         "recording": true,
4826         "status": "active"
4827       }
4828     ]
4829   }
4832 = Checking Bitmap bitmap0 =
4833 expecting 6 dirty sectors; have 6. OK!
4835 --- Reference Backup #1 ---
4838 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4839 {"return": {}}
4842 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4843 {"return": {}}
4845 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
4846 {"return": {}}
4847 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4849 {"return": ""}
4851 --- Test Backup #1 ---
4854 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4855 {"return": {}}
4858 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4859 {"return": {}}
4861 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "top", "target": "backup_target_1"}}
4862 {"return": {}}
4863 {"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4864 {"data": {"device": "backup_1", "error": "Input/output error", "len": 458752, "offset": 65536, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4866   "bitmaps": {
4867     "device0": [
4868       {
4869         "busy": false,
4870         "count": 393216,
4871         "granularity": 65536,
4872         "name": "bitmap0",
4873         "persistent": false,
4874         "recording": true,
4875         "status": "active"
4876       }
4877     ]
4878   }
4881 = Checking Bitmap bitmap0 =
4882 expecting 6 dirty sectors; have 6. OK!
4884 --- Write #3 ---
4886 write -P0xaa 0x0010000 0x30000
4887 {"return": ""}
4888 write -P0xbb 0x00d8000 0x10000
4889 {"return": ""}
4890 write -P0xcc 0x2028000 0x10000
4891 {"return": ""}
4892 write -P0xdd 0x3fc0000 0x10000
4893 {"return": ""}
4895   "bitmaps": {
4896     "device0": [
4897       {
4898         "busy": false,
4899         "count": 917504,
4900         "granularity": 65536,
4901         "name": "bitmap0",
4902         "persistent": false,
4903         "recording": true,
4904         "status": "active"
4905       }
4906     ]
4907   }
4910 = Checking Bitmap bitmap0 =
4911 expecting 14 dirty sectors; have 14. OK!
4913 --- Reference Backup #2 ---
4916 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4917 {"return": {}}
4920 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4921 {"return": {}}
4923 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
4924 {"return": {}}
4925 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4927 --- Test Backup #2 ---
4930 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
4931 {"return": {}}
4934 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
4935 {"return": {}}
4937 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
4938 {"return": {}}
4939 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
4940 {"return": {}}
4941 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4942 {"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
4944   "bitmaps": {
4945     "device0": [
4946       {
4947         "busy": false,
4948         "count": 0,
4949         "granularity": 65536,
4950         "name": "bitmap0",
4951         "persistent": false,
4952         "recording": true,
4953         "status": "active"
4954       }
4955     ]
4956   }
4959 = Checking Bitmap bitmap0 =
4960 expecting 0 dirty sectors; have 0. OK!
4962 --- Cleanup ---
4964 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
4965 {"return": {}}
4967   "bitmaps": {
4968     "device0": []
4969   }
4972 --- Verification ---
4974 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
4975 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4976 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
4979 === Mode top; Bitmap Sync always without failure ===
4981 --- Preparing image & VM ---
4983 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
4984 {"return": {}}
4985 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0", "share-rw": true}}
4986 {"return": {}}
4988 --- Write #0 ---
4990 write -P0x49 0x0000000 0x10000
4991 {"return": ""}
4992 write -P0x6c 0x0100000 0x10000
4993 {"return": ""}
4994 write -P0x6f 0x2000000 0x10000
4995 {"return": ""}
4996 write -P0x76 0x3ff0000 0x10000
4997 {"return": ""}
4999   "bitmaps": {
5000     "device0": []
5001   }
5004 --- Reference Backup #0 ---
5007 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
5008 {"return": {}}
5011 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
5012 {"return": {}}
5014 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0"}}
5015 {"return": {}}
5016 {"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
5018 --- Add Bitmap ---
5020 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
5021 {"return": {}}
5023 --- Write #1 ---
5025 write -P0x65 0x0000000 0x10000
5026 {"return": ""}
5027 write -P0x77 0x00f8000 0x10000
5028 {"return": ""}
5029 write -P0x72 0x2008000 0x10000
5030 {"return": ""}
5031 write -P0x69 0x3fe0000 0x10000
5032 {"return": ""}
5034   "bitmaps": {
5035     "device0": [
5036       {
5037         "busy": false,
5038         "count": 393216,
5039         "granularity": 65536,
5040         "name": "bitmap0",
5041         "persistent": false,
5042         "recording": true,
5043         "status": "active"
5044       }
5045     ]
5046   }
5049 = Checking Bitmap bitmap0 =
5050 expecting 6 dirty sectors; have 6. OK!
5052 --- Reference Backup #1 ---
5055 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
5056 {"return": {}}
5059 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
5060 {"return": {}}
5062 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1"}}
5063 {"return": {}}
5064 {"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
5066 --- Test Backup #1 ---
5069 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
5070 {"return": {}}
5073 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
5074 {"return": {}}
5076 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_1", "sync": "top", "target": "backup_target_1"}}
5077 {"return": {}}
5079 --- Write #2 ---
5081 write -P0x74 0x0010000 0x10000
5082 {"return": ""}
5083 write -P0x69 0x00e8000 0x10000
5084 {"return": ""}
5085 write -P0x6e 0x2018000 0x10000
5086 {"return": ""}
5087 write -P0x67 0x3fe0000 0x20000
5088 {"return": ""}
5090   "bitmaps": {
5091     "device0": [
5092       {
5093         "busy": false,
5094         "count": 0,
5095         "granularity": 65536,
5096         "persistent": false,
5097         "recording": false,
5098         "status": "disabled"
5099       },
5100       {
5101         "busy": false,
5102         "count": 458752,
5103         "granularity": 65536,
5104         "persistent": false,
5105         "recording": true,
5106         "status": "active"
5107       },
5108       {
5109         "busy": true,
5110         "count": 393216,
5111         "granularity": 65536,
5112         "name": "bitmap0",
5113         "persistent": false,
5114         "recording": true,
5115         "status": "frozen"
5116       }
5117     ]
5118   }
5121 = Checking Bitmap bitmap0 =
5122 expecting 6 dirty sectors; have 6. OK!
5124 = Checking Bitmap (anonymous) =
5125 expecting 7 dirty sectors; have 7. OK!
5127 {"execute": "job-finalize", "arguments": {"id": "backup_1"}}
5128 {"return": {}}
5129 {"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
5130 {"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
5132   "bitmaps": {
5133     "device0": [
5134       {
5135         "busy": false,
5136         "count": 458752,
5137         "granularity": 65536,
5138         "name": "bitmap0",
5139         "persistent": false,
5140         "recording": true,
5141         "status": "active"
5142       }
5143     ]
5144   }
5147 = Checking Bitmap bitmap0 =
5148 expecting 7 dirty sectors; have 7. OK!
5150 --- Write #3 ---
5152 write -P0xaa 0x0010000 0x30000
5153 {"return": ""}
5154 write -P0xbb 0x00d8000 0x10000
5155 {"return": ""}
5156 write -P0xcc 0x2028000 0x10000
5157 {"return": ""}
5158 write -P0xdd 0x3fc0000 0x10000
5159 {"return": ""}
5161   "bitmaps": {
5162     "device0": [
5163       {
5164         "busy": false,
5165         "count": 786432,
5166         "granularity": 65536,
5167         "name": "bitmap0",
5168         "persistent": false,
5169         "recording": true,
5170         "status": "active"
5171       }
5172     ]
5173   }
5176 = Checking Bitmap bitmap0 =
5177 expecting 12 dirty sectors; have 12. OK!
5179 --- Reference Backup #2 ---
5182 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
5183 {"return": {}}
5186 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
5187 {"return": {}}
5189 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2"}}
5190 {"return": {}}
5191 {"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
5193 --- Test Backup #2 ---
5196 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
5197 {"return": {}}
5200 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
5201 {"return": {}}
5203 {"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2"}}
5204 {"return": {}}
5205 {"execute": "job-finalize", "arguments": {"id": "backup_2"}}
5206 {"return": {}}
5207 {"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
5208 {"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
5210   "bitmaps": {
5211     "device0": [
5212       {
5213         "busy": false,
5214         "count": 0,
5215         "granularity": 65536,
5216         "name": "bitmap0",
5217         "persistent": false,
5218         "recording": true,
5219         "status": "active"
5220       }
5221     ]
5222   }
5225 = Checking Bitmap bitmap0 =
5226 expecting 0 dirty sectors; have 0. OK!
5228 --- Cleanup ---
5230 {"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
5231 {"return": {}}
5233   "bitmaps": {
5234     "device0": []
5235   }
5238 --- Verification ---
5240 qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
5241 qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
5242 qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
5245 === API failure tests ===
5247 --- Preparing image & VM ---
5249 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
5250 {"return": {}}
5251 {"execute": "device_add", "arguments": {"drive": "drive0", "driver": "scsi-hd", "id": "device0"}}
5252 {"return": {}}
5255 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
5256 {"return": {}}
5259 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
5260 {"return": {}}
5263 {"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
5264 {"return": {}}
5266 -- Testing invalid QMP commands --
5268 -- Sync mode incremental tests --
5270 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5271 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
5273 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5274 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
5276 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5277 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
5279 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5280 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
5282 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5283 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5285 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5286 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
5288 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5289 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
5291 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5292 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5294 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5295 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
5297 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "incremental", "target": "backup_target"}}
5298 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
5300 -- Sync mode bitmap tests --
5302 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5303 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
5305 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5306 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
5308 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5309 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
5311 {"execute": "blockdev-backup", "arguments": {"device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5312 {"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
5314 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5315 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5317 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5318 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5320 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5321 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5323 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5324 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5326 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "job-id": "api_job", "sync": "bitmap", "target": "backup_target"}}
5327 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}
5329 -- Sync mode full tests --
5331 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5332 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5334 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5335 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5337 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5338 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5340 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5341 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5343 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5344 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5346 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5347 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5349 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5350 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5352 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5353 {"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has no meaningful effect when combined with sync mode 'full'"}}
5355 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "job-id": "api_job", "sync": "full", "target": "backup_target"}}
5356 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}
5358 -- Sync mode top tests --
5360 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5361 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5363 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5364 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5366 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5367 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5369 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5370 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5372 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5373 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5375 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5376 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5378 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5379 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5381 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5382 {"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has no meaningful effect when combined with sync mode 'top'"}}
5384 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "job-id": "api_job", "sync": "top", "target": "backup_target"}}
5385 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}
5387 -- Sync mode none tests --
5389 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5390 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5392 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5393 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5395 {"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5396 {"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
5398 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5399 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5401 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5402 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5404 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5405 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5407 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5408 {"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
5410 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5411 {"error": {"class": "GenericError", "desc": "sync mode 'none' does not produce meaningful bitmap outputs"}}
5413 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5414 {"error": {"class": "GenericError", "desc": "sync mode 'none' does not produce meaningful bitmap outputs"}}
5416 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5417 {"error": {"class": "GenericError", "desc": "sync mode 'none' does not produce meaningful bitmap outputs"}}
5419 {"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "job-id": "api_job", "sync": "none", "target": "backup_target"}}
5420 {"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}