cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

257.out (160037B)


      1
      2=== Mode bitmap; Bitmap Sync never with simulated failure ===
      3
      4--- Preparing image & VM ---
      5
      6{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
      7{"return": {}}
      8
      9--- Write #0 ---
     10
     11write -P0x49 0x0000000 0x10000
     12{"return": ""}
     13write -P0x6c 0x0100000 0x10000
     14{"return": ""}
     15write -P0x6f 0x2000000 0x10000
     16{"return": ""}
     17write -P0x76 0x3ff0000 0x10000
     18{"return": ""}
     19{
     20  "bitmaps": {}
     21}
     22
     23--- Reference Backup #0 ---
     24
     25{}
     26{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
     27{"return": {}}
     28{}
     29{}
     30{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
     31{"return": {}}
     32{}
     33{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
     34{"return": {}}
     35{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
     36
     37--- Add Bitmap ---
     38
     39{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
     40{"return": {}}
     41
     42--- Write #1 ---
     43
     44write -P0x65 0x0000000 0x10000
     45{"return": ""}
     46write -P0x77 0x00f8000 0x10000
     47{"return": ""}
     48write -P0x72 0x2008000 0x10000
     49{"return": ""}
     50write -P0x69 0x3fe0000 0x10000
     51{"return": ""}
     52{
     53  "bitmaps": {
     54    "drive0": [
     55      {
     56        "busy": false,
     57        "count": 393216,
     58        "granularity": 65536,
     59        "name": "bitmap0",
     60        "persistent": false,
     61        "recording": true
     62      }
     63    ]
     64  }
     65}
     66
     67= Checking Bitmap bitmap0 =
     68expecting 6 dirty sectors; have 6. OK!
     69
     70--- Reference Backup #1 ---
     71
     72{}
     73{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
     74{"return": {}}
     75{}
     76{}
     77{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
     78{"return": {}}
     79{}
     80{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
     81{"return": {}}
     82{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
     83
     84--- Test Backup #1 ---
     85
     86{}
     87{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
     88{"return": {}}
     89{}
     90{}
     91{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
     92{"return": {}}
     93{}
     94{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
     95{"return": {}}
     96
     97--- Write #2 ---
     98
     99write -P0x74 0x0010000 0x10000
    100{"return": ""}
    101write -P0x69 0x00e8000 0x10000
    102{"return": ""}
    103write -P0x6e 0x2018000 0x10000
    104{"return": ""}
    105write -P0x67 0x3fe0000 0x20000
    106{"return": ""}
    107{
    108  "bitmaps": {
    109    "drive0": [
    110      {
    111        "busy": false,
    112        "count": 0,
    113        "granularity": 65536,
    114        "persistent": false,
    115        "recording": false
    116      },
    117      {
    118        "busy": false,
    119        "count": 458752,
    120        "granularity": 65536,
    121        "persistent": false,
    122        "recording": true
    123      },
    124      {
    125        "busy": true,
    126        "count": 393216,
    127        "granularity": 65536,
    128        "name": "bitmap0",
    129        "persistent": false,
    130        "recording": true
    131      }
    132    ]
    133  }
    134}
    135
    136= Checking Bitmap bitmap0 =
    137expecting 6 dirty sectors; have 6. OK!
    138
    139= Checking Bitmap (anonymous) =
    140expecting 7 dirty sectors; have 7. OK!
    141
    142{"execute": "job-cancel", "arguments": {"id": "backup_1"}}
    143{"return": {}}
    144{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    145{"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    146{
    147  "bitmaps": {
    148    "drive0": [
    149      {
    150        "busy": false,
    151        "count": 655360,
    152        "granularity": 65536,
    153        "name": "bitmap0",
    154        "persistent": false,
    155        "recording": true
    156      }
    157    ]
    158  }
    159}
    160
    161= Checking Bitmap bitmap0 =
    162expecting 10 dirty sectors; have 10. OK!
    163
    164--- Write #3 ---
    165
    166write -P0xaa 0x0010000 0x30000
    167{"return": ""}
    168write -P0xbb 0x00d8000 0x10000
    169{"return": ""}
    170write -P0xcc 0x2028000 0x10000
    171{"return": ""}
    172write -P0xdd 0x3fc0000 0x10000
    173{"return": ""}
    174{
    175  "bitmaps": {
    176    "drive0": [
    177      {
    178        "busy": false,
    179        "count": 983040,
    180        "granularity": 65536,
    181        "name": "bitmap0",
    182        "persistent": false,
    183        "recording": true
    184      }
    185    ]
    186  }
    187}
    188
    189= Checking Bitmap bitmap0 =
    190expecting 15 dirty sectors; have 15. OK!
    191
    192--- Reference Backup #2 ---
    193
    194{}
    195{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    196{"return": {}}
    197{}
    198{}
    199{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    200{"return": {}}
    201{}
    202{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
    203{"return": {}}
    204{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    205
    206--- Test Backup #2 ---
    207
    208{}
    209{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    210{"return": {}}
    211{}
    212{}
    213{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    214{"return": {}}
    215{}
    216{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
    217{"return": {}}
    218{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
    219{"return": {}}
    220{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    221{"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    222{
    223  "bitmaps": {
    224    "drive0": [
    225      {
    226        "busy": false,
    227        "count": 983040,
    228        "granularity": 65536,
    229        "name": "bitmap0",
    230        "persistent": false,
    231        "recording": true
    232      }
    233    ]
    234  }
    235}
    236
    237= Checking Bitmap bitmap0 =
    238expecting 15 dirty sectors; have 15. OK!
    239
    240--- Cleanup ---
    241
    242{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
    243{"return": {}}
    244{
    245  "bitmaps": {}
    246}
    247
    248--- Verification ---
    249
    250qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
    251qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    252qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    253
    254
    255=== Mode bitmap; Bitmap Sync never with intermediate failure ===
    256
    257--- Preparing image & VM ---
    258
    259{"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"}}
    260{"return": {}}
    261
    262--- Write #0 ---
    263
    264write -P0x49 0x0000000 0x10000
    265{"return": ""}
    266write -P0x6c 0x0100000 0x10000
    267{"return": ""}
    268write -P0x6f 0x2000000 0x10000
    269{"return": ""}
    270write -P0x76 0x3ff0000 0x10000
    271{"return": ""}
    272{
    273  "bitmaps": {}
    274}
    275
    276--- Reference Backup #0 ---
    277
    278{}
    279{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    280{"return": {}}
    281{}
    282{}
    283{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    284{"return": {}}
    285{}
    286{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
    287{"return": {}}
    288{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    289
    290--- Add Bitmap ---
    291
    292{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
    293{"return": {}}
    294
    295--- Write #1 ---
    296
    297write -P0x65 0x0000000 0x10000
    298{"return": ""}
    299write -P0x77 0x00f8000 0x10000
    300{"return": ""}
    301write -P0x72 0x2008000 0x10000
    302{"return": ""}
    303write -P0x69 0x3fe0000 0x10000
    304{"return": ""}
    305{
    306  "bitmaps": {
    307    "drive0": [
    308      {
    309        "busy": false,
    310        "count": 393216,
    311        "granularity": 65536,
    312        "name": "bitmap0",
    313        "persistent": false,
    314        "recording": true
    315      }
    316    ]
    317  }
    318}
    319
    320= Checking Bitmap bitmap0 =
    321expecting 6 dirty sectors; have 6. OK!
    322
    323--- Reference Backup #1 ---
    324
    325{}
    326{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    327{"return": {}}
    328{}
    329{}
    330{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    331{"return": {}}
    332{}
    333{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
    334{"return": {}}
    335{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    336
    337{"return": ""}
    338
    339--- Test Backup #1 ---
    340
    341{}
    342{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    343{"return": {}}
    344{}
    345{}
    346{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    347{"return": {}}
    348{}
    349{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
    350{"return": {}}
    351{"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    352{"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"}}
    353{
    354  "bitmaps": {
    355    "drive0": [
    356      {
    357        "busy": false,
    358        "count": 393216,
    359        "granularity": 65536,
    360        "name": "bitmap0",
    361        "persistent": false,
    362        "recording": true
    363      }
    364    ]
    365  }
    366}
    367
    368= Checking Bitmap bitmap0 =
    369expecting 6 dirty sectors; have 6. OK!
    370
    371--- Write #3 ---
    372
    373write -P0xaa 0x0010000 0x30000
    374{"return": ""}
    375write -P0xbb 0x00d8000 0x10000
    376{"return": ""}
    377write -P0xcc 0x2028000 0x10000
    378{"return": ""}
    379write -P0xdd 0x3fc0000 0x10000
    380{"return": ""}
    381{
    382  "bitmaps": {
    383    "drive0": [
    384      {
    385        "busy": false,
    386        "count": 917504,
    387        "granularity": 65536,
    388        "name": "bitmap0",
    389        "persistent": false,
    390        "recording": true
    391      }
    392    ]
    393  }
    394}
    395
    396= Checking Bitmap bitmap0 =
    397expecting 14 dirty sectors; have 14. OK!
    398
    399--- Reference Backup #2 ---
    400
    401{}
    402{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    403{"return": {}}
    404{}
    405{}
    406{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    407{"return": {}}
    408{}
    409{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
    410{"return": {}}
    411{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    412
    413--- Test Backup #2 ---
    414
    415{}
    416{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    417{"return": {}}
    418{}
    419{}
    420{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    421{"return": {}}
    422{}
    423{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
    424{"return": {}}
    425{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
    426{"return": {}}
    427{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    428{"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    429{
    430  "bitmaps": {
    431    "drive0": [
    432      {
    433        "busy": false,
    434        "count": 917504,
    435        "granularity": 65536,
    436        "name": "bitmap0",
    437        "persistent": false,
    438        "recording": true
    439      }
    440    ]
    441  }
    442}
    443
    444= Checking Bitmap bitmap0 =
    445expecting 14 dirty sectors; have 14. OK!
    446
    447--- Cleanup ---
    448
    449{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
    450{"return": {}}
    451{
    452  "bitmaps": {}
    453}
    454
    455--- Verification ---
    456
    457qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
    458qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    459qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    460
    461
    462=== Mode bitmap; Bitmap Sync never without failure ===
    463
    464--- Preparing image & VM ---
    465
    466{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
    467{"return": {}}
    468
    469--- Write #0 ---
    470
    471write -P0x49 0x0000000 0x10000
    472{"return": ""}
    473write -P0x6c 0x0100000 0x10000
    474{"return": ""}
    475write -P0x6f 0x2000000 0x10000
    476{"return": ""}
    477write -P0x76 0x3ff0000 0x10000
    478{"return": ""}
    479{
    480  "bitmaps": {}
    481}
    482
    483--- Reference Backup #0 ---
    484
    485{}
    486{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    487{"return": {}}
    488{}
    489{}
    490{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    491{"return": {}}
    492{}
    493{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
    494{"return": {}}
    495{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    496
    497--- Add Bitmap ---
    498
    499{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
    500{"return": {}}
    501
    502--- Write #1 ---
    503
    504write -P0x65 0x0000000 0x10000
    505{"return": ""}
    506write -P0x77 0x00f8000 0x10000
    507{"return": ""}
    508write -P0x72 0x2008000 0x10000
    509{"return": ""}
    510write -P0x69 0x3fe0000 0x10000
    511{"return": ""}
    512{
    513  "bitmaps": {
    514    "drive0": [
    515      {
    516        "busy": false,
    517        "count": 393216,
    518        "granularity": 65536,
    519        "name": "bitmap0",
    520        "persistent": false,
    521        "recording": true
    522      }
    523    ]
    524  }
    525}
    526
    527= Checking Bitmap bitmap0 =
    528expecting 6 dirty sectors; have 6. OK!
    529
    530--- Reference Backup #1 ---
    531
    532{}
    533{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    534{"return": {}}
    535{}
    536{}
    537{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    538{"return": {}}
    539{}
    540{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
    541{"return": {}}
    542{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    543
    544--- Test Backup #1 ---
    545
    546{}
    547{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    548{"return": {}}
    549{}
    550{}
    551{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    552{"return": {}}
    553{}
    554{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
    555{"return": {}}
    556
    557--- Write #2 ---
    558
    559write -P0x74 0x0010000 0x10000
    560{"return": ""}
    561write -P0x69 0x00e8000 0x10000
    562{"return": ""}
    563write -P0x6e 0x2018000 0x10000
    564{"return": ""}
    565write -P0x67 0x3fe0000 0x20000
    566{"return": ""}
    567{
    568  "bitmaps": {
    569    "drive0": [
    570      {
    571        "busy": false,
    572        "count": 0,
    573        "granularity": 65536,
    574        "persistent": false,
    575        "recording": false
    576      },
    577      {
    578        "busy": false,
    579        "count": 458752,
    580        "granularity": 65536,
    581        "persistent": false,
    582        "recording": true
    583      },
    584      {
    585        "busy": true,
    586        "count": 393216,
    587        "granularity": 65536,
    588        "name": "bitmap0",
    589        "persistent": false,
    590        "recording": true
    591      }
    592    ]
    593  }
    594}
    595
    596= Checking Bitmap bitmap0 =
    597expecting 6 dirty sectors; have 6. OK!
    598
    599= Checking Bitmap (anonymous) =
    600expecting 7 dirty sectors; have 7. OK!
    601
    602{"execute": "job-finalize", "arguments": {"id": "backup_1"}}
    603{"return": {}}
    604{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    605{"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    606{
    607  "bitmaps": {
    608    "drive0": [
    609      {
    610        "busy": false,
    611        "count": 655360,
    612        "granularity": 65536,
    613        "name": "bitmap0",
    614        "persistent": false,
    615        "recording": true
    616      }
    617    ]
    618  }
    619}
    620
    621= Checking Bitmap bitmap0 =
    622expecting 10 dirty sectors; have 10. OK!
    623
    624--- Write #3 ---
    625
    626write -P0xaa 0x0010000 0x30000
    627{"return": ""}
    628write -P0xbb 0x00d8000 0x10000
    629{"return": ""}
    630write -P0xcc 0x2028000 0x10000
    631{"return": ""}
    632write -P0xdd 0x3fc0000 0x10000
    633{"return": ""}
    634{
    635  "bitmaps": {
    636    "drive0": [
    637      {
    638        "busy": false,
    639        "count": 983040,
    640        "granularity": 65536,
    641        "name": "bitmap0",
    642        "persistent": false,
    643        "recording": true
    644      }
    645    ]
    646  }
    647}
    648
    649= Checking Bitmap bitmap0 =
    650expecting 15 dirty sectors; have 15. OK!
    651
    652--- Reference Backup #2 ---
    653
    654{}
    655{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    656{"return": {}}
    657{}
    658{}
    659{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    660{"return": {}}
    661{}
    662{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
    663{"return": {}}
    664{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    665
    666--- Test Backup #2 ---
    667
    668{}
    669{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    670{"return": {}}
    671{}
    672{}
    673{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    674{"return": {}}
    675{}
    676{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
    677{"return": {}}
    678{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
    679{"return": {}}
    680{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    681{"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    682{
    683  "bitmaps": {
    684    "drive0": [
    685      {
    686        "busy": false,
    687        "count": 983040,
    688        "granularity": 65536,
    689        "name": "bitmap0",
    690        "persistent": false,
    691        "recording": true
    692      }
    693    ]
    694  }
    695}
    696
    697= Checking Bitmap bitmap0 =
    698expecting 15 dirty sectors; have 15. OK!
    699
    700--- Cleanup ---
    701
    702{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
    703{"return": {}}
    704{
    705  "bitmaps": {}
    706}
    707
    708--- Verification ---
    709
    710qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
    711qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    712qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    713
    714
    715=== Mode bitmap; Bitmap Sync on-success with simulated failure ===
    716
    717--- Preparing image & VM ---
    718
    719{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
    720{"return": {}}
    721
    722--- Write #0 ---
    723
    724write -P0x49 0x0000000 0x10000
    725{"return": ""}
    726write -P0x6c 0x0100000 0x10000
    727{"return": ""}
    728write -P0x6f 0x2000000 0x10000
    729{"return": ""}
    730write -P0x76 0x3ff0000 0x10000
    731{"return": ""}
    732{
    733  "bitmaps": {}
    734}
    735
    736--- Reference Backup #0 ---
    737
    738{}
    739{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    740{"return": {}}
    741{}
    742{}
    743{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    744{"return": {}}
    745{}
    746{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
    747{"return": {}}
    748{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    749
    750--- Add Bitmap ---
    751
    752{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
    753{"return": {}}
    754
    755--- Write #1 ---
    756
    757write -P0x65 0x0000000 0x10000
    758{"return": ""}
    759write -P0x77 0x00f8000 0x10000
    760{"return": ""}
    761write -P0x72 0x2008000 0x10000
    762{"return": ""}
    763write -P0x69 0x3fe0000 0x10000
    764{"return": ""}
    765{
    766  "bitmaps": {
    767    "drive0": [
    768      {
    769        "busy": false,
    770        "count": 393216,
    771        "granularity": 65536,
    772        "name": "bitmap0",
    773        "persistent": false,
    774        "recording": true
    775      }
    776    ]
    777  }
    778}
    779
    780= Checking Bitmap bitmap0 =
    781expecting 6 dirty sectors; have 6. OK!
    782
    783--- Reference Backup #1 ---
    784
    785{}
    786{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    787{"return": {}}
    788{}
    789{}
    790{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    791{"return": {}}
    792{}
    793{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
    794{"return": {}}
    795{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    796
    797--- Test Backup #1 ---
    798
    799{}
    800{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    801{"return": {}}
    802{}
    803{}
    804{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    805{"return": {}}
    806{}
    807{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
    808{"return": {}}
    809
    810--- Write #2 ---
    811
    812write -P0x74 0x0010000 0x10000
    813{"return": ""}
    814write -P0x69 0x00e8000 0x10000
    815{"return": ""}
    816write -P0x6e 0x2018000 0x10000
    817{"return": ""}
    818write -P0x67 0x3fe0000 0x20000
    819{"return": ""}
    820{
    821  "bitmaps": {
    822    "drive0": [
    823      {
    824        "busy": false,
    825        "count": 0,
    826        "granularity": 65536,
    827        "persistent": false,
    828        "recording": false
    829      },
    830      {
    831        "busy": false,
    832        "count": 458752,
    833        "granularity": 65536,
    834        "persistent": false,
    835        "recording": true
    836      },
    837      {
    838        "busy": true,
    839        "count": 393216,
    840        "granularity": 65536,
    841        "name": "bitmap0",
    842        "persistent": false,
    843        "recording": true
    844      }
    845    ]
    846  }
    847}
    848
    849= Checking Bitmap bitmap0 =
    850expecting 6 dirty sectors; have 6. OK!
    851
    852= Checking Bitmap (anonymous) =
    853expecting 7 dirty sectors; have 7. OK!
    854
    855{"execute": "job-cancel", "arguments": {"id": "backup_1"}}
    856{"return": {}}
    857{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    858{"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    859{
    860  "bitmaps": {
    861    "drive0": [
    862      {
    863        "busy": false,
    864        "count": 655360,
    865        "granularity": 65536,
    866        "name": "bitmap0",
    867        "persistent": false,
    868        "recording": true
    869      }
    870    ]
    871  }
    872}
    873
    874= Checking Bitmap bitmap0 =
    875expecting 10 dirty sectors; have 10. OK!
    876
    877--- Write #3 ---
    878
    879write -P0xaa 0x0010000 0x30000
    880{"return": ""}
    881write -P0xbb 0x00d8000 0x10000
    882{"return": ""}
    883write -P0xcc 0x2028000 0x10000
    884{"return": ""}
    885write -P0xdd 0x3fc0000 0x10000
    886{"return": ""}
    887{
    888  "bitmaps": {
    889    "drive0": [
    890      {
    891        "busy": false,
    892        "count": 983040,
    893        "granularity": 65536,
    894        "name": "bitmap0",
    895        "persistent": false,
    896        "recording": true
    897      }
    898    ]
    899  }
    900}
    901
    902= Checking Bitmap bitmap0 =
    903expecting 15 dirty sectors; have 15. OK!
    904
    905--- Reference Backup #2 ---
    906
    907{}
    908{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    909{"return": {}}
    910{}
    911{}
    912{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    913{"return": {}}
    914{}
    915{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
    916{"return": {}}
    917{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    918
    919--- Test Backup #2 ---
    920
    921{}
    922{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    923{"return": {}}
    924{}
    925{}
    926{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    927{"return": {}}
    928{}
    929{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
    930{"return": {}}
    931{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
    932{"return": {}}
    933{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    934{"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
    935{
    936  "bitmaps": {
    937    "drive0": [
    938      {
    939        "busy": false,
    940        "count": 0,
    941        "granularity": 65536,
    942        "name": "bitmap0",
    943        "persistent": false,
    944        "recording": true
    945      }
    946    ]
    947  }
    948}
    949
    950= Checking Bitmap bitmap0 =
    951expecting 0 dirty sectors; have 0. OK!
    952
    953--- Cleanup ---
    954
    955{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
    956{"return": {}}
    957{
    958  "bitmaps": {}
    959}
    960
    961--- Verification ---
    962
    963qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
    964qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    965qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
    966
    967
    968=== Mode bitmap; Bitmap Sync on-success with intermediate failure ===
    969
    970--- Preparing image & VM ---
    971
    972{"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"}}
    973{"return": {}}
    974
    975--- Write #0 ---
    976
    977write -P0x49 0x0000000 0x10000
    978{"return": ""}
    979write -P0x6c 0x0100000 0x10000
    980{"return": ""}
    981write -P0x6f 0x2000000 0x10000
    982{"return": ""}
    983write -P0x76 0x3ff0000 0x10000
    984{"return": ""}
    985{
    986  "bitmaps": {}
    987}
    988
    989--- Reference Backup #0 ---
    990
    991{}
    992{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
    993{"return": {}}
    994{}
    995{}
    996{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
    997{"return": {}}
    998{}
    999{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   1000{"return": {}}
   1001{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1002
   1003--- Add Bitmap ---
   1004
   1005{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   1006{"return": {}}
   1007
   1008--- Write #1 ---
   1009
   1010write -P0x65 0x0000000 0x10000
   1011{"return": ""}
   1012write -P0x77 0x00f8000 0x10000
   1013{"return": ""}
   1014write -P0x72 0x2008000 0x10000
   1015{"return": ""}
   1016write -P0x69 0x3fe0000 0x10000
   1017{"return": ""}
   1018{
   1019  "bitmaps": {
   1020    "drive0": [
   1021      {
   1022        "busy": false,
   1023        "count": 393216,
   1024        "granularity": 65536,
   1025        "name": "bitmap0",
   1026        "persistent": false,
   1027        "recording": true
   1028      }
   1029    ]
   1030  }
   1031}
   1032
   1033= Checking Bitmap bitmap0 =
   1034expecting 6 dirty sectors; have 6. OK!
   1035
   1036--- Reference Backup #1 ---
   1037
   1038{}
   1039{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1040{"return": {}}
   1041{}
   1042{}
   1043{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1044{"return": {}}
   1045{}
   1046{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   1047{"return": {}}
   1048{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1049
   1050{"return": ""}
   1051
   1052--- Test Backup #1 ---
   1053
   1054{}
   1055{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1056{"return": {}}
   1057{}
   1058{}
   1059{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1060{"return": {}}
   1061{}
   1062{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   1063{"return": {}}
   1064{"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1065{"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"}}
   1066{
   1067  "bitmaps": {
   1068    "drive0": [
   1069      {
   1070        "busy": false,
   1071        "count": 393216,
   1072        "granularity": 65536,
   1073        "name": "bitmap0",
   1074        "persistent": false,
   1075        "recording": true
   1076      }
   1077    ]
   1078  }
   1079}
   1080
   1081= Checking Bitmap bitmap0 =
   1082expecting 6 dirty sectors; have 6. OK!
   1083
   1084--- Write #3 ---
   1085
   1086write -P0xaa 0x0010000 0x30000
   1087{"return": ""}
   1088write -P0xbb 0x00d8000 0x10000
   1089{"return": ""}
   1090write -P0xcc 0x2028000 0x10000
   1091{"return": ""}
   1092write -P0xdd 0x3fc0000 0x10000
   1093{"return": ""}
   1094{
   1095  "bitmaps": {
   1096    "drive0": [
   1097      {
   1098        "busy": false,
   1099        "count": 917504,
   1100        "granularity": 65536,
   1101        "name": "bitmap0",
   1102        "persistent": false,
   1103        "recording": true
   1104      }
   1105    ]
   1106  }
   1107}
   1108
   1109= Checking Bitmap bitmap0 =
   1110expecting 14 dirty sectors; have 14. OK!
   1111
   1112--- Reference Backup #2 ---
   1113
   1114{}
   1115{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1116{"return": {}}
   1117{}
   1118{}
   1119{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1120{"return": {}}
   1121{}
   1122{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   1123{"return": {}}
   1124{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1125
   1126--- Test Backup #2 ---
   1127
   1128{}
   1129{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1130{"return": {}}
   1131{}
   1132{}
   1133{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1134{"return": {}}
   1135{}
   1136{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   1137{"return": {}}
   1138{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   1139{"return": {}}
   1140{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1141{"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1142{
   1143  "bitmaps": {
   1144    "drive0": [
   1145      {
   1146        "busy": false,
   1147        "count": 0,
   1148        "granularity": 65536,
   1149        "name": "bitmap0",
   1150        "persistent": false,
   1151        "recording": true
   1152      }
   1153    ]
   1154  }
   1155}
   1156
   1157= Checking Bitmap bitmap0 =
   1158expecting 0 dirty sectors; have 0. OK!
   1159
   1160--- Cleanup ---
   1161
   1162{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   1163{"return": {}}
   1164{
   1165  "bitmaps": {}
   1166}
   1167
   1168--- Verification ---
   1169
   1170qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
   1171qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1172qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1173
   1174
   1175=== Mode bitmap; Bitmap Sync on-success without failure ===
   1176
   1177--- Preparing image & VM ---
   1178
   1179{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   1180{"return": {}}
   1181
   1182--- Write #0 ---
   1183
   1184write -P0x49 0x0000000 0x10000
   1185{"return": ""}
   1186write -P0x6c 0x0100000 0x10000
   1187{"return": ""}
   1188write -P0x6f 0x2000000 0x10000
   1189{"return": ""}
   1190write -P0x76 0x3ff0000 0x10000
   1191{"return": ""}
   1192{
   1193  "bitmaps": {}
   1194}
   1195
   1196--- Reference Backup #0 ---
   1197
   1198{}
   1199{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1200{"return": {}}
   1201{}
   1202{}
   1203{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1204{"return": {}}
   1205{}
   1206{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   1207{"return": {}}
   1208{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1209
   1210--- Add Bitmap ---
   1211
   1212{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   1213{"return": {}}
   1214
   1215--- Write #1 ---
   1216
   1217write -P0x65 0x0000000 0x10000
   1218{"return": ""}
   1219write -P0x77 0x00f8000 0x10000
   1220{"return": ""}
   1221write -P0x72 0x2008000 0x10000
   1222{"return": ""}
   1223write -P0x69 0x3fe0000 0x10000
   1224{"return": ""}
   1225{
   1226  "bitmaps": {
   1227    "drive0": [
   1228      {
   1229        "busy": false,
   1230        "count": 393216,
   1231        "granularity": 65536,
   1232        "name": "bitmap0",
   1233        "persistent": false,
   1234        "recording": true
   1235      }
   1236    ]
   1237  }
   1238}
   1239
   1240= Checking Bitmap bitmap0 =
   1241expecting 6 dirty sectors; have 6. OK!
   1242
   1243--- Reference Backup #1 ---
   1244
   1245{}
   1246{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1247{"return": {}}
   1248{}
   1249{}
   1250{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1251{"return": {}}
   1252{}
   1253{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   1254{"return": {}}
   1255{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1256
   1257--- Test Backup #1 ---
   1258
   1259{}
   1260{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1261{"return": {}}
   1262{}
   1263{}
   1264{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1265{"return": {}}
   1266{}
   1267{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   1268{"return": {}}
   1269
   1270--- Write #2 ---
   1271
   1272write -P0x74 0x0010000 0x10000
   1273{"return": ""}
   1274write -P0x69 0x00e8000 0x10000
   1275{"return": ""}
   1276write -P0x6e 0x2018000 0x10000
   1277{"return": ""}
   1278write -P0x67 0x3fe0000 0x20000
   1279{"return": ""}
   1280{
   1281  "bitmaps": {
   1282    "drive0": [
   1283      {
   1284        "busy": false,
   1285        "count": 0,
   1286        "granularity": 65536,
   1287        "persistent": false,
   1288        "recording": false
   1289      },
   1290      {
   1291        "busy": false,
   1292        "count": 458752,
   1293        "granularity": 65536,
   1294        "persistent": false,
   1295        "recording": true
   1296      },
   1297      {
   1298        "busy": true,
   1299        "count": 393216,
   1300        "granularity": 65536,
   1301        "name": "bitmap0",
   1302        "persistent": false,
   1303        "recording": true
   1304      }
   1305    ]
   1306  }
   1307}
   1308
   1309= Checking Bitmap bitmap0 =
   1310expecting 6 dirty sectors; have 6. OK!
   1311
   1312= Checking Bitmap (anonymous) =
   1313expecting 7 dirty sectors; have 7. OK!
   1314
   1315{"execute": "job-finalize", "arguments": {"id": "backup_1"}}
   1316{"return": {}}
   1317{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1318{"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1319{
   1320  "bitmaps": {
   1321    "drive0": [
   1322      {
   1323        "busy": false,
   1324        "count": 458752,
   1325        "granularity": 65536,
   1326        "name": "bitmap0",
   1327        "persistent": false,
   1328        "recording": true
   1329      }
   1330    ]
   1331  }
   1332}
   1333
   1334= Checking Bitmap bitmap0 =
   1335expecting 7 dirty sectors; have 7. OK!
   1336
   1337--- Write #3 ---
   1338
   1339write -P0xaa 0x0010000 0x30000
   1340{"return": ""}
   1341write -P0xbb 0x00d8000 0x10000
   1342{"return": ""}
   1343write -P0xcc 0x2028000 0x10000
   1344{"return": ""}
   1345write -P0xdd 0x3fc0000 0x10000
   1346{"return": ""}
   1347{
   1348  "bitmaps": {
   1349    "drive0": [
   1350      {
   1351        "busy": false,
   1352        "count": 786432,
   1353        "granularity": 65536,
   1354        "name": "bitmap0",
   1355        "persistent": false,
   1356        "recording": true
   1357      }
   1358    ]
   1359  }
   1360}
   1361
   1362= Checking Bitmap bitmap0 =
   1363expecting 12 dirty sectors; have 12. OK!
   1364
   1365--- Reference Backup #2 ---
   1366
   1367{}
   1368{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1369{"return": {}}
   1370{}
   1371{}
   1372{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1373{"return": {}}
   1374{}
   1375{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   1376{"return": {}}
   1377{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1378
   1379--- Test Backup #2 ---
   1380
   1381{}
   1382{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1383{"return": {}}
   1384{}
   1385{}
   1386{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1387{"return": {}}
   1388{}
   1389{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   1390{"return": {}}
   1391{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   1392{"return": {}}
   1393{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1394{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1395{
   1396  "bitmaps": {
   1397    "drive0": [
   1398      {
   1399        "busy": false,
   1400        "count": 0,
   1401        "granularity": 65536,
   1402        "name": "bitmap0",
   1403        "persistent": false,
   1404        "recording": true
   1405      }
   1406    ]
   1407  }
   1408}
   1409
   1410= Checking Bitmap bitmap0 =
   1411expecting 0 dirty sectors; have 0. OK!
   1412
   1413--- Cleanup ---
   1414
   1415{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   1416{"return": {}}
   1417{
   1418  "bitmaps": {}
   1419}
   1420
   1421--- Verification ---
   1422
   1423qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   1424qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1425qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1426
   1427
   1428=== Mode bitmap; Bitmap Sync always with simulated failure ===
   1429
   1430--- Preparing image & VM ---
   1431
   1432{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   1433{"return": {}}
   1434
   1435--- Write #0 ---
   1436
   1437write -P0x49 0x0000000 0x10000
   1438{"return": ""}
   1439write -P0x6c 0x0100000 0x10000
   1440{"return": ""}
   1441write -P0x6f 0x2000000 0x10000
   1442{"return": ""}
   1443write -P0x76 0x3ff0000 0x10000
   1444{"return": ""}
   1445{
   1446  "bitmaps": {}
   1447}
   1448
   1449--- Reference Backup #0 ---
   1450
   1451{}
   1452{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1453{"return": {}}
   1454{}
   1455{}
   1456{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1457{"return": {}}
   1458{}
   1459{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   1460{"return": {}}
   1461{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1462
   1463--- Add Bitmap ---
   1464
   1465{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   1466{"return": {}}
   1467
   1468--- Write #1 ---
   1469
   1470write -P0x65 0x0000000 0x10000
   1471{"return": ""}
   1472write -P0x77 0x00f8000 0x10000
   1473{"return": ""}
   1474write -P0x72 0x2008000 0x10000
   1475{"return": ""}
   1476write -P0x69 0x3fe0000 0x10000
   1477{"return": ""}
   1478{
   1479  "bitmaps": {
   1480    "drive0": [
   1481      {
   1482        "busy": false,
   1483        "count": 393216,
   1484        "granularity": 65536,
   1485        "name": "bitmap0",
   1486        "persistent": false,
   1487        "recording": true
   1488      }
   1489    ]
   1490  }
   1491}
   1492
   1493= Checking Bitmap bitmap0 =
   1494expecting 6 dirty sectors; have 6. OK!
   1495
   1496--- Reference Backup #1 ---
   1497
   1498{}
   1499{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1500{"return": {}}
   1501{}
   1502{}
   1503{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1504{"return": {}}
   1505{}
   1506{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   1507{"return": {}}
   1508{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1509
   1510--- Test Backup #1 ---
   1511
   1512{}
   1513{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1514{"return": {}}
   1515{}
   1516{}
   1517{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1518{"return": {}}
   1519{}
   1520{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   1521{"return": {}}
   1522
   1523--- Write #2 ---
   1524
   1525write -P0x74 0x0010000 0x10000
   1526{"return": ""}
   1527write -P0x69 0x00e8000 0x10000
   1528{"return": ""}
   1529write -P0x6e 0x2018000 0x10000
   1530{"return": ""}
   1531write -P0x67 0x3fe0000 0x20000
   1532{"return": ""}
   1533{
   1534  "bitmaps": {
   1535    "drive0": [
   1536      {
   1537        "busy": false,
   1538        "count": 0,
   1539        "granularity": 65536,
   1540        "persistent": false,
   1541        "recording": false
   1542      },
   1543      {
   1544        "busy": false,
   1545        "count": 458752,
   1546        "granularity": 65536,
   1547        "persistent": false,
   1548        "recording": true
   1549      },
   1550      {
   1551        "busy": true,
   1552        "count": 393216,
   1553        "granularity": 65536,
   1554        "name": "bitmap0",
   1555        "persistent": false,
   1556        "recording": true
   1557      }
   1558    ]
   1559  }
   1560}
   1561
   1562= Checking Bitmap bitmap0 =
   1563expecting 6 dirty sectors; have 6. OK!
   1564
   1565= Checking Bitmap (anonymous) =
   1566expecting 7 dirty sectors; have 7. OK!
   1567
   1568{"execute": "job-cancel", "arguments": {"id": "backup_1"}}
   1569{"return": {}}
   1570{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1571{"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1572{
   1573  "bitmaps": {
   1574    "drive0": [
   1575      {
   1576        "busy": false,
   1577        "count": 458752,
   1578        "granularity": 65536,
   1579        "name": "bitmap0",
   1580        "persistent": false,
   1581        "recording": true
   1582      }
   1583    ]
   1584  }
   1585}
   1586
   1587= Checking Bitmap bitmap0 =
   1588expecting 7 dirty sectors; have 7. OK!
   1589
   1590--- Write #3 ---
   1591
   1592write -P0xaa 0x0010000 0x30000
   1593{"return": ""}
   1594write -P0xbb 0x00d8000 0x10000
   1595{"return": ""}
   1596write -P0xcc 0x2028000 0x10000
   1597{"return": ""}
   1598write -P0xdd 0x3fc0000 0x10000
   1599{"return": ""}
   1600{
   1601  "bitmaps": {
   1602    "drive0": [
   1603      {
   1604        "busy": false,
   1605        "count": 786432,
   1606        "granularity": 65536,
   1607        "name": "bitmap0",
   1608        "persistent": false,
   1609        "recording": true
   1610      }
   1611    ]
   1612  }
   1613}
   1614
   1615= Checking Bitmap bitmap0 =
   1616expecting 12 dirty sectors; have 12. OK!
   1617
   1618--- Reference Backup #2 ---
   1619
   1620{}
   1621{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1622{"return": {}}
   1623{}
   1624{}
   1625{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1626{"return": {}}
   1627{}
   1628{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   1629{"return": {}}
   1630{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1631
   1632--- Test Backup #2 ---
   1633
   1634{}
   1635{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1636{"return": {}}
   1637{}
   1638{}
   1639{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1640{"return": {}}
   1641{}
   1642{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   1643{"return": {}}
   1644{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   1645{"return": {}}
   1646{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1647{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1648{
   1649  "bitmaps": {
   1650    "drive0": [
   1651      {
   1652        "busy": false,
   1653        "count": 0,
   1654        "granularity": 65536,
   1655        "name": "bitmap0",
   1656        "persistent": false,
   1657        "recording": true
   1658      }
   1659    ]
   1660  }
   1661}
   1662
   1663= Checking Bitmap bitmap0 =
   1664expecting 0 dirty sectors; have 0. OK!
   1665
   1666--- Cleanup ---
   1667
   1668{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   1669{"return": {}}
   1670{
   1671  "bitmaps": {}
   1672}
   1673
   1674--- Verification ---
   1675
   1676qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   1677qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1678qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1679
   1680
   1681=== Mode bitmap; Bitmap Sync always with intermediate failure ===
   1682
   1683--- Preparing image & VM ---
   1684
   1685{"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"}}
   1686{"return": {}}
   1687
   1688--- Write #0 ---
   1689
   1690write -P0x49 0x0000000 0x10000
   1691{"return": ""}
   1692write -P0x6c 0x0100000 0x10000
   1693{"return": ""}
   1694write -P0x6f 0x2000000 0x10000
   1695{"return": ""}
   1696write -P0x76 0x3ff0000 0x10000
   1697{"return": ""}
   1698{
   1699  "bitmaps": {}
   1700}
   1701
   1702--- Reference Backup #0 ---
   1703
   1704{}
   1705{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1706{"return": {}}
   1707{}
   1708{}
   1709{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1710{"return": {}}
   1711{}
   1712{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   1713{"return": {}}
   1714{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1715
   1716--- Add Bitmap ---
   1717
   1718{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   1719{"return": {}}
   1720
   1721--- Write #1 ---
   1722
   1723write -P0x65 0x0000000 0x10000
   1724{"return": ""}
   1725write -P0x77 0x00f8000 0x10000
   1726{"return": ""}
   1727write -P0x72 0x2008000 0x10000
   1728{"return": ""}
   1729write -P0x69 0x3fe0000 0x10000
   1730{"return": ""}
   1731{
   1732  "bitmaps": {
   1733    "drive0": [
   1734      {
   1735        "busy": false,
   1736        "count": 393216,
   1737        "granularity": 65536,
   1738        "name": "bitmap0",
   1739        "persistent": false,
   1740        "recording": true
   1741      }
   1742    ]
   1743  }
   1744}
   1745
   1746= Checking Bitmap bitmap0 =
   1747expecting 6 dirty sectors; have 6. OK!
   1748
   1749--- Reference Backup #1 ---
   1750
   1751{}
   1752{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1753{"return": {}}
   1754{}
   1755{}
   1756{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1757{"return": {}}
   1758{}
   1759{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   1760{"return": {}}
   1761{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1762
   1763{"return": ""}
   1764
   1765--- Test Backup #1 ---
   1766
   1767{}
   1768{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1769{"return": {}}
   1770{}
   1771{}
   1772{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1773{"return": {}}
   1774{}
   1775{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   1776{"return": {}}
   1777{"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1778{"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"}}
   1779{
   1780  "bitmaps": {
   1781    "drive0": [
   1782      {
   1783        "busy": false,
   1784        "count": 327680,
   1785        "granularity": 65536,
   1786        "name": "bitmap0",
   1787        "persistent": false,
   1788        "recording": true
   1789      }
   1790    ]
   1791  }
   1792}
   1793
   1794= Checking Bitmap bitmap0 =
   1795expecting 5 dirty sectors; have 5. OK!
   1796
   1797--- Write #3 ---
   1798
   1799write -P0xaa 0x0010000 0x30000
   1800{"return": ""}
   1801write -P0xbb 0x00d8000 0x10000
   1802{"return": ""}
   1803write -P0xcc 0x2028000 0x10000
   1804{"return": ""}
   1805write -P0xdd 0x3fc0000 0x10000
   1806{"return": ""}
   1807{
   1808  "bitmaps": {
   1809    "drive0": [
   1810      {
   1811        "busy": false,
   1812        "count": 851968,
   1813        "granularity": 65536,
   1814        "name": "bitmap0",
   1815        "persistent": false,
   1816        "recording": true
   1817      }
   1818    ]
   1819  }
   1820}
   1821
   1822= Checking Bitmap bitmap0 =
   1823expecting 13 dirty sectors; have 13. OK!
   1824
   1825--- Reference Backup #2 ---
   1826
   1827{}
   1828{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1829{"return": {}}
   1830{}
   1831{}
   1832{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1833{"return": {}}
   1834{}
   1835{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   1836{"return": {}}
   1837{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1838
   1839--- Test Backup #2 ---
   1840
   1841{}
   1842{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1843{"return": {}}
   1844{}
   1845{}
   1846{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1847{"return": {}}
   1848{}
   1849{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   1850{"return": {}}
   1851{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   1852{"return": {}}
   1853{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1854{"data": {"device": "backup_2", "len": 851968, "offset": 851968, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1855{
   1856  "bitmaps": {
   1857    "drive0": [
   1858      {
   1859        "busy": false,
   1860        "count": 0,
   1861        "granularity": 65536,
   1862        "name": "bitmap0",
   1863        "persistent": false,
   1864        "recording": true
   1865      }
   1866    ]
   1867  }
   1868}
   1869
   1870= Checking Bitmap bitmap0 =
   1871expecting 0 dirty sectors; have 0. OK!
   1872
   1873--- Cleanup ---
   1874
   1875{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   1876{"return": {}}
   1877{
   1878  "bitmaps": {}
   1879}
   1880
   1881--- Verification ---
   1882
   1883qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
   1884qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1885qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   1886
   1887
   1888=== Mode bitmap; Bitmap Sync always without failure ===
   1889
   1890--- Preparing image & VM ---
   1891
   1892{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   1893{"return": {}}
   1894
   1895--- Write #0 ---
   1896
   1897write -P0x49 0x0000000 0x10000
   1898{"return": ""}
   1899write -P0x6c 0x0100000 0x10000
   1900{"return": ""}
   1901write -P0x6f 0x2000000 0x10000
   1902{"return": ""}
   1903write -P0x76 0x3ff0000 0x10000
   1904{"return": ""}
   1905{
   1906  "bitmaps": {}
   1907}
   1908
   1909--- Reference Backup #0 ---
   1910
   1911{}
   1912{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1913{"return": {}}
   1914{}
   1915{}
   1916{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1917{"return": {}}
   1918{}
   1919{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   1920{"return": {}}
   1921{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1922
   1923--- Add Bitmap ---
   1924
   1925{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   1926{"return": {}}
   1927
   1928--- Write #1 ---
   1929
   1930write -P0x65 0x0000000 0x10000
   1931{"return": ""}
   1932write -P0x77 0x00f8000 0x10000
   1933{"return": ""}
   1934write -P0x72 0x2008000 0x10000
   1935{"return": ""}
   1936write -P0x69 0x3fe0000 0x10000
   1937{"return": ""}
   1938{
   1939  "bitmaps": {
   1940    "drive0": [
   1941      {
   1942        "busy": false,
   1943        "count": 393216,
   1944        "granularity": 65536,
   1945        "name": "bitmap0",
   1946        "persistent": false,
   1947        "recording": true
   1948      }
   1949    ]
   1950  }
   1951}
   1952
   1953= Checking Bitmap bitmap0 =
   1954expecting 6 dirty sectors; have 6. OK!
   1955
   1956--- Reference Backup #1 ---
   1957
   1958{}
   1959{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1960{"return": {}}
   1961{}
   1962{}
   1963{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1964{"return": {}}
   1965{}
   1966{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   1967{"return": {}}
   1968{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   1969
   1970--- Test Backup #1 ---
   1971
   1972{}
   1973{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   1974{"return": {}}
   1975{}
   1976{}
   1977{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   1978{"return": {}}
   1979{}
   1980{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "bitmap", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   1981{"return": {}}
   1982
   1983--- Write #2 ---
   1984
   1985write -P0x74 0x0010000 0x10000
   1986{"return": ""}
   1987write -P0x69 0x00e8000 0x10000
   1988{"return": ""}
   1989write -P0x6e 0x2018000 0x10000
   1990{"return": ""}
   1991write -P0x67 0x3fe0000 0x20000
   1992{"return": ""}
   1993{
   1994  "bitmaps": {
   1995    "drive0": [
   1996      {
   1997        "busy": false,
   1998        "count": 0,
   1999        "granularity": 65536,
   2000        "persistent": false,
   2001        "recording": false
   2002      },
   2003      {
   2004        "busy": false,
   2005        "count": 458752,
   2006        "granularity": 65536,
   2007        "persistent": false,
   2008        "recording": true
   2009      },
   2010      {
   2011        "busy": true,
   2012        "count": 393216,
   2013        "granularity": 65536,
   2014        "name": "bitmap0",
   2015        "persistent": false,
   2016        "recording": true
   2017      }
   2018    ]
   2019  }
   2020}
   2021
   2022= Checking Bitmap bitmap0 =
   2023expecting 6 dirty sectors; have 6. OK!
   2024
   2025= Checking Bitmap (anonymous) =
   2026expecting 7 dirty sectors; have 7. OK!
   2027
   2028{"execute": "job-finalize", "arguments": {"id": "backup_1"}}
   2029{"return": {}}
   2030{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2031{"data": {"device": "backup_1", "len": 393216, "offset": 393216, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2032{
   2033  "bitmaps": {
   2034    "drive0": [
   2035      {
   2036        "busy": false,
   2037        "count": 458752,
   2038        "granularity": 65536,
   2039        "name": "bitmap0",
   2040        "persistent": false,
   2041        "recording": true
   2042      }
   2043    ]
   2044  }
   2045}
   2046
   2047= Checking Bitmap bitmap0 =
   2048expecting 7 dirty sectors; have 7. OK!
   2049
   2050--- Write #3 ---
   2051
   2052write -P0xaa 0x0010000 0x30000
   2053{"return": ""}
   2054write -P0xbb 0x00d8000 0x10000
   2055{"return": ""}
   2056write -P0xcc 0x2028000 0x10000
   2057{"return": ""}
   2058write -P0xdd 0x3fc0000 0x10000
   2059{"return": ""}
   2060{
   2061  "bitmaps": {
   2062    "drive0": [
   2063      {
   2064        "busy": false,
   2065        "count": 786432,
   2066        "granularity": 65536,
   2067        "name": "bitmap0",
   2068        "persistent": false,
   2069        "recording": true
   2070      }
   2071    ]
   2072  }
   2073}
   2074
   2075= Checking Bitmap bitmap0 =
   2076expecting 12 dirty sectors; have 12. OK!
   2077
   2078--- Reference Backup #2 ---
   2079
   2080{}
   2081{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2082{"return": {}}
   2083{}
   2084{}
   2085{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2086{"return": {}}
   2087{}
   2088{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   2089{"return": {}}
   2090{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2091
   2092--- Test Backup #2 ---
   2093
   2094{}
   2095{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2096{"return": {}}
   2097{}
   2098{}
   2099{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2100{"return": {}}
   2101{}
   2102{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   2103{"return": {}}
   2104{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   2105{"return": {}}
   2106{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2107{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2108{
   2109  "bitmaps": {
   2110    "drive0": [
   2111      {
   2112        "busy": false,
   2113        "count": 0,
   2114        "granularity": 65536,
   2115        "name": "bitmap0",
   2116        "persistent": false,
   2117        "recording": true
   2118      }
   2119    ]
   2120  }
   2121}
   2122
   2123= Checking Bitmap bitmap0 =
   2124expecting 0 dirty sectors; have 0. OK!
   2125
   2126--- Cleanup ---
   2127
   2128{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   2129{"return": {}}
   2130{
   2131  "bitmaps": {}
   2132}
   2133
   2134--- Verification ---
   2135
   2136qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   2137qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2138qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2139
   2140
   2141=== Mode full; Bitmap Sync on-success with simulated failure ===
   2142
   2143--- Preparing image & VM ---
   2144
   2145{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   2146{"return": {}}
   2147
   2148--- Write #0 ---
   2149
   2150write -P0x49 0x0000000 0x10000
   2151{"return": ""}
   2152write -P0x6c 0x0100000 0x10000
   2153{"return": ""}
   2154write -P0x6f 0x2000000 0x10000
   2155{"return": ""}
   2156write -P0x76 0x3ff0000 0x10000
   2157{"return": ""}
   2158{
   2159  "bitmaps": {}
   2160}
   2161
   2162--- Reference Backup #0 ---
   2163
   2164{}
   2165{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2166{"return": {}}
   2167{}
   2168{}
   2169{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2170{"return": {}}
   2171{}
   2172{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   2173{"return": {}}
   2174{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2175
   2176--- Add Bitmap ---
   2177
   2178{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   2179{"return": {}}
   2180
   2181--- Write #1 ---
   2182
   2183write -P0x65 0x0000000 0x10000
   2184{"return": ""}
   2185write -P0x77 0x00f8000 0x10000
   2186{"return": ""}
   2187write -P0x72 0x2008000 0x10000
   2188{"return": ""}
   2189write -P0x69 0x3fe0000 0x10000
   2190{"return": ""}
   2191{
   2192  "bitmaps": {
   2193    "drive0": [
   2194      {
   2195        "busy": false,
   2196        "count": 393216,
   2197        "granularity": 65536,
   2198        "name": "bitmap0",
   2199        "persistent": false,
   2200        "recording": true
   2201      }
   2202    ]
   2203  }
   2204}
   2205
   2206= Checking Bitmap bitmap0 =
   2207expecting 6 dirty sectors; have 6. OK!
   2208
   2209--- Reference Backup #1 ---
   2210
   2211{}
   2212{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2213{"return": {}}
   2214{}
   2215{}
   2216{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2217{"return": {}}
   2218{}
   2219{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   2220{"return": {}}
   2221{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2222
   2223--- Test Backup #1 ---
   2224
   2225{}
   2226{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2227{"return": {}}
   2228{}
   2229{}
   2230{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2231{"return": {}}
   2232{}
   2233{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   2234{"return": {}}
   2235
   2236--- Write #2 ---
   2237
   2238write -P0x74 0x0010000 0x10000
   2239{"return": ""}
   2240write -P0x69 0x00e8000 0x10000
   2241{"return": ""}
   2242write -P0x6e 0x2018000 0x10000
   2243{"return": ""}
   2244write -P0x67 0x3fe0000 0x20000
   2245{"return": ""}
   2246{
   2247  "bitmaps": {
   2248    "drive0": [
   2249      {
   2250        "busy": false,
   2251        "count": 0,
   2252        "granularity": 65536,
   2253        "persistent": false,
   2254        "recording": false
   2255      },
   2256      {
   2257        "busy": false,
   2258        "count": 458752,
   2259        "granularity": 65536,
   2260        "persistent": false,
   2261        "recording": true
   2262      },
   2263      {
   2264        "busy": true,
   2265        "count": 393216,
   2266        "granularity": 65536,
   2267        "name": "bitmap0",
   2268        "persistent": false,
   2269        "recording": true
   2270      }
   2271    ]
   2272  }
   2273}
   2274
   2275= Checking Bitmap bitmap0 =
   2276expecting 6 dirty sectors; have 6. OK!
   2277
   2278= Checking Bitmap (anonymous) =
   2279expecting 7 dirty sectors; have 7. OK!
   2280
   2281{"execute": "job-cancel", "arguments": {"id": "backup_1"}}
   2282{"return": {}}
   2283{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2284{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2285{
   2286  "bitmaps": {
   2287    "drive0": [
   2288      {
   2289        "busy": false,
   2290        "count": 655360,
   2291        "granularity": 65536,
   2292        "name": "bitmap0",
   2293        "persistent": false,
   2294        "recording": true
   2295      }
   2296    ]
   2297  }
   2298}
   2299
   2300= Checking Bitmap bitmap0 =
   2301expecting 10 dirty sectors; have 10. OK!
   2302
   2303--- Write #3 ---
   2304
   2305write -P0xaa 0x0010000 0x30000
   2306{"return": ""}
   2307write -P0xbb 0x00d8000 0x10000
   2308{"return": ""}
   2309write -P0xcc 0x2028000 0x10000
   2310{"return": ""}
   2311write -P0xdd 0x3fc0000 0x10000
   2312{"return": ""}
   2313{
   2314  "bitmaps": {
   2315    "drive0": [
   2316      {
   2317        "busy": false,
   2318        "count": 983040,
   2319        "granularity": 65536,
   2320        "name": "bitmap0",
   2321        "persistent": false,
   2322        "recording": true
   2323      }
   2324    ]
   2325  }
   2326}
   2327
   2328= Checking Bitmap bitmap0 =
   2329expecting 15 dirty sectors; have 15. OK!
   2330
   2331--- Reference Backup #2 ---
   2332
   2333{}
   2334{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2335{"return": {}}
   2336{}
   2337{}
   2338{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2339{"return": {}}
   2340{}
   2341{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   2342{"return": {}}
   2343{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2344
   2345--- Test Backup #2 ---
   2346
   2347{}
   2348{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2349{"return": {}}
   2350{}
   2351{}
   2352{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2353{"return": {}}
   2354{}
   2355{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   2356{"return": {}}
   2357{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   2358{"return": {}}
   2359{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2360{"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2361{
   2362  "bitmaps": {
   2363    "drive0": [
   2364      {
   2365        "busy": false,
   2366        "count": 0,
   2367        "granularity": 65536,
   2368        "name": "bitmap0",
   2369        "persistent": false,
   2370        "recording": true
   2371      }
   2372    ]
   2373  }
   2374}
   2375
   2376= Checking Bitmap bitmap0 =
   2377expecting 0 dirty sectors; have 0. OK!
   2378
   2379--- Cleanup ---
   2380
   2381{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   2382{"return": {}}
   2383{
   2384  "bitmaps": {}
   2385}
   2386
   2387--- Verification ---
   2388
   2389qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   2390qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2391qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2392
   2393
   2394=== Mode full; Bitmap Sync on-success with intermediate failure ===
   2395
   2396--- Preparing image & VM ---
   2397
   2398{"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"}}
   2399{"return": {}}
   2400
   2401--- Write #0 ---
   2402
   2403write -P0x49 0x0000000 0x10000
   2404{"return": ""}
   2405write -P0x6c 0x0100000 0x10000
   2406{"return": ""}
   2407write -P0x6f 0x2000000 0x10000
   2408{"return": ""}
   2409write -P0x76 0x3ff0000 0x10000
   2410{"return": ""}
   2411{
   2412  "bitmaps": {}
   2413}
   2414
   2415--- Reference Backup #0 ---
   2416
   2417{}
   2418{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2419{"return": {}}
   2420{}
   2421{}
   2422{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2423{"return": {}}
   2424{}
   2425{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   2426{"return": {}}
   2427{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2428
   2429--- Add Bitmap ---
   2430
   2431{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   2432{"return": {}}
   2433
   2434--- Write #1 ---
   2435
   2436write -P0x65 0x0000000 0x10000
   2437{"return": ""}
   2438write -P0x77 0x00f8000 0x10000
   2439{"return": ""}
   2440write -P0x72 0x2008000 0x10000
   2441{"return": ""}
   2442write -P0x69 0x3fe0000 0x10000
   2443{"return": ""}
   2444{
   2445  "bitmaps": {
   2446    "drive0": [
   2447      {
   2448        "busy": false,
   2449        "count": 393216,
   2450        "granularity": 65536,
   2451        "name": "bitmap0",
   2452        "persistent": false,
   2453        "recording": true
   2454      }
   2455    ]
   2456  }
   2457}
   2458
   2459= Checking Bitmap bitmap0 =
   2460expecting 6 dirty sectors; have 6. OK!
   2461
   2462--- Reference Backup #1 ---
   2463
   2464{}
   2465{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2466{"return": {}}
   2467{}
   2468{}
   2469{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2470{"return": {}}
   2471{}
   2472{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   2473{"return": {}}
   2474{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2475
   2476{"return": ""}
   2477
   2478--- Test Backup #1 ---
   2479
   2480{}
   2481{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2482{"return": {}}
   2483{}
   2484{}
   2485{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2486{"return": {}}
   2487{}
   2488{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   2489{"return": {}}
   2490{"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2491{"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"}}
   2492{
   2493  "bitmaps": {
   2494    "drive0": [
   2495      {
   2496        "busy": false,
   2497        "count": 393216,
   2498        "granularity": 65536,
   2499        "name": "bitmap0",
   2500        "persistent": false,
   2501        "recording": true
   2502      }
   2503    ]
   2504  }
   2505}
   2506
   2507= Checking Bitmap bitmap0 =
   2508expecting 6 dirty sectors; have 6. OK!
   2509
   2510--- Write #3 ---
   2511
   2512write -P0xaa 0x0010000 0x30000
   2513{"return": ""}
   2514write -P0xbb 0x00d8000 0x10000
   2515{"return": ""}
   2516write -P0xcc 0x2028000 0x10000
   2517{"return": ""}
   2518write -P0xdd 0x3fc0000 0x10000
   2519{"return": ""}
   2520{
   2521  "bitmaps": {
   2522    "drive0": [
   2523      {
   2524        "busy": false,
   2525        "count": 917504,
   2526        "granularity": 65536,
   2527        "name": "bitmap0",
   2528        "persistent": false,
   2529        "recording": true
   2530      }
   2531    ]
   2532  }
   2533}
   2534
   2535= Checking Bitmap bitmap0 =
   2536expecting 14 dirty sectors; have 14. OK!
   2537
   2538--- Reference Backup #2 ---
   2539
   2540{}
   2541{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2542{"return": {}}
   2543{}
   2544{}
   2545{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2546{"return": {}}
   2547{}
   2548{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   2549{"return": {}}
   2550{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2551
   2552--- Test Backup #2 ---
   2553
   2554{}
   2555{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2556{"return": {}}
   2557{}
   2558{}
   2559{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2560{"return": {}}
   2561{}
   2562{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   2563{"return": {}}
   2564{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   2565{"return": {}}
   2566{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2567{"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2568{
   2569  "bitmaps": {
   2570    "drive0": [
   2571      {
   2572        "busy": false,
   2573        "count": 0,
   2574        "granularity": 65536,
   2575        "name": "bitmap0",
   2576        "persistent": false,
   2577        "recording": true
   2578      }
   2579    ]
   2580  }
   2581}
   2582
   2583= Checking Bitmap bitmap0 =
   2584expecting 0 dirty sectors; have 0. OK!
   2585
   2586--- Cleanup ---
   2587
   2588{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   2589{"return": {}}
   2590{
   2591  "bitmaps": {}
   2592}
   2593
   2594--- Verification ---
   2595
   2596qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
   2597qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2598qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2599
   2600
   2601=== Mode full; Bitmap Sync on-success without failure ===
   2602
   2603--- Preparing image & VM ---
   2604
   2605{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   2606{"return": {}}
   2607
   2608--- Write #0 ---
   2609
   2610write -P0x49 0x0000000 0x10000
   2611{"return": ""}
   2612write -P0x6c 0x0100000 0x10000
   2613{"return": ""}
   2614write -P0x6f 0x2000000 0x10000
   2615{"return": ""}
   2616write -P0x76 0x3ff0000 0x10000
   2617{"return": ""}
   2618{
   2619  "bitmaps": {}
   2620}
   2621
   2622--- Reference Backup #0 ---
   2623
   2624{}
   2625{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2626{"return": {}}
   2627{}
   2628{}
   2629{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2630{"return": {}}
   2631{}
   2632{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   2633{"return": {}}
   2634{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2635
   2636--- Add Bitmap ---
   2637
   2638{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   2639{"return": {}}
   2640
   2641--- Write #1 ---
   2642
   2643write -P0x65 0x0000000 0x10000
   2644{"return": ""}
   2645write -P0x77 0x00f8000 0x10000
   2646{"return": ""}
   2647write -P0x72 0x2008000 0x10000
   2648{"return": ""}
   2649write -P0x69 0x3fe0000 0x10000
   2650{"return": ""}
   2651{
   2652  "bitmaps": {
   2653    "drive0": [
   2654      {
   2655        "busy": false,
   2656        "count": 393216,
   2657        "granularity": 65536,
   2658        "name": "bitmap0",
   2659        "persistent": false,
   2660        "recording": true
   2661      }
   2662    ]
   2663  }
   2664}
   2665
   2666= Checking Bitmap bitmap0 =
   2667expecting 6 dirty sectors; have 6. OK!
   2668
   2669--- Reference Backup #1 ---
   2670
   2671{}
   2672{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2673{"return": {}}
   2674{}
   2675{}
   2676{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2677{"return": {}}
   2678{}
   2679{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   2680{"return": {}}
   2681{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2682
   2683--- Test Backup #1 ---
   2684
   2685{}
   2686{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2687{"return": {}}
   2688{}
   2689{}
   2690{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2691{"return": {}}
   2692{}
   2693{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   2694{"return": {}}
   2695
   2696--- Write #2 ---
   2697
   2698write -P0x74 0x0010000 0x10000
   2699{"return": ""}
   2700write -P0x69 0x00e8000 0x10000
   2701{"return": ""}
   2702write -P0x6e 0x2018000 0x10000
   2703{"return": ""}
   2704write -P0x67 0x3fe0000 0x20000
   2705{"return": ""}
   2706{
   2707  "bitmaps": {
   2708    "drive0": [
   2709      {
   2710        "busy": false,
   2711        "count": 0,
   2712        "granularity": 65536,
   2713        "persistent": false,
   2714        "recording": false
   2715      },
   2716      {
   2717        "busy": false,
   2718        "count": 458752,
   2719        "granularity": 65536,
   2720        "persistent": false,
   2721        "recording": true
   2722      },
   2723      {
   2724        "busy": true,
   2725        "count": 393216,
   2726        "granularity": 65536,
   2727        "name": "bitmap0",
   2728        "persistent": false,
   2729        "recording": true
   2730      }
   2731    ]
   2732  }
   2733}
   2734
   2735= Checking Bitmap bitmap0 =
   2736expecting 6 dirty sectors; have 6. OK!
   2737
   2738= Checking Bitmap (anonymous) =
   2739expecting 7 dirty sectors; have 7. OK!
   2740
   2741{"execute": "job-finalize", "arguments": {"id": "backup_1"}}
   2742{"return": {}}
   2743{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2744{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2745{
   2746  "bitmaps": {
   2747    "drive0": [
   2748      {
   2749        "busy": false,
   2750        "count": 458752,
   2751        "granularity": 65536,
   2752        "name": "bitmap0",
   2753        "persistent": false,
   2754        "recording": true
   2755      }
   2756    ]
   2757  }
   2758}
   2759
   2760= Checking Bitmap bitmap0 =
   2761expecting 7 dirty sectors; have 7. OK!
   2762
   2763--- Write #3 ---
   2764
   2765write -P0xaa 0x0010000 0x30000
   2766{"return": ""}
   2767write -P0xbb 0x00d8000 0x10000
   2768{"return": ""}
   2769write -P0xcc 0x2028000 0x10000
   2770{"return": ""}
   2771write -P0xdd 0x3fc0000 0x10000
   2772{"return": ""}
   2773{
   2774  "bitmaps": {
   2775    "drive0": [
   2776      {
   2777        "busy": false,
   2778        "count": 786432,
   2779        "granularity": 65536,
   2780        "name": "bitmap0",
   2781        "persistent": false,
   2782        "recording": true
   2783      }
   2784    ]
   2785  }
   2786}
   2787
   2788= Checking Bitmap bitmap0 =
   2789expecting 12 dirty sectors; have 12. OK!
   2790
   2791--- Reference Backup #2 ---
   2792
   2793{}
   2794{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2795{"return": {}}
   2796{}
   2797{}
   2798{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2799{"return": {}}
   2800{}
   2801{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   2802{"return": {}}
   2803{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2804
   2805--- Test Backup #2 ---
   2806
   2807{}
   2808{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2809{"return": {}}
   2810{}
   2811{}
   2812{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2813{"return": {}}
   2814{}
   2815{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   2816{"return": {}}
   2817{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   2818{"return": {}}
   2819{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2820{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2821{
   2822  "bitmaps": {
   2823    "drive0": [
   2824      {
   2825        "busy": false,
   2826        "count": 0,
   2827        "granularity": 65536,
   2828        "name": "bitmap0",
   2829        "persistent": false,
   2830        "recording": true
   2831      }
   2832    ]
   2833  }
   2834}
   2835
   2836= Checking Bitmap bitmap0 =
   2837expecting 0 dirty sectors; have 0. OK!
   2838
   2839--- Cleanup ---
   2840
   2841{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   2842{"return": {}}
   2843{
   2844  "bitmaps": {}
   2845}
   2846
   2847--- Verification ---
   2848
   2849qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   2850qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2851qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   2852
   2853
   2854=== Mode full; Bitmap Sync always with simulated failure ===
   2855
   2856--- Preparing image & VM ---
   2857
   2858{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   2859{"return": {}}
   2860
   2861--- Write #0 ---
   2862
   2863write -P0x49 0x0000000 0x10000
   2864{"return": ""}
   2865write -P0x6c 0x0100000 0x10000
   2866{"return": ""}
   2867write -P0x6f 0x2000000 0x10000
   2868{"return": ""}
   2869write -P0x76 0x3ff0000 0x10000
   2870{"return": ""}
   2871{
   2872  "bitmaps": {}
   2873}
   2874
   2875--- Reference Backup #0 ---
   2876
   2877{}
   2878{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2879{"return": {}}
   2880{}
   2881{}
   2882{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2883{"return": {}}
   2884{}
   2885{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   2886{"return": {}}
   2887{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2888
   2889--- Add Bitmap ---
   2890
   2891{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   2892{"return": {}}
   2893
   2894--- Write #1 ---
   2895
   2896write -P0x65 0x0000000 0x10000
   2897{"return": ""}
   2898write -P0x77 0x00f8000 0x10000
   2899{"return": ""}
   2900write -P0x72 0x2008000 0x10000
   2901{"return": ""}
   2902write -P0x69 0x3fe0000 0x10000
   2903{"return": ""}
   2904{
   2905  "bitmaps": {
   2906    "drive0": [
   2907      {
   2908        "busy": false,
   2909        "count": 393216,
   2910        "granularity": 65536,
   2911        "name": "bitmap0",
   2912        "persistent": false,
   2913        "recording": true
   2914      }
   2915    ]
   2916  }
   2917}
   2918
   2919= Checking Bitmap bitmap0 =
   2920expecting 6 dirty sectors; have 6. OK!
   2921
   2922--- Reference Backup #1 ---
   2923
   2924{}
   2925{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2926{"return": {}}
   2927{}
   2928{}
   2929{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2930{"return": {}}
   2931{}
   2932{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   2933{"return": {}}
   2934{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2935
   2936--- Test Backup #1 ---
   2937
   2938{}
   2939{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   2940{"return": {}}
   2941{}
   2942{}
   2943{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   2944{"return": {}}
   2945{}
   2946{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   2947{"return": {}}
   2948
   2949--- Write #2 ---
   2950
   2951write -P0x74 0x0010000 0x10000
   2952{"return": ""}
   2953write -P0x69 0x00e8000 0x10000
   2954{"return": ""}
   2955write -P0x6e 0x2018000 0x10000
   2956{"return": ""}
   2957write -P0x67 0x3fe0000 0x20000
   2958{"return": ""}
   2959{
   2960  "bitmaps": {
   2961    "drive0": [
   2962      {
   2963        "busy": false,
   2964        "count": 0,
   2965        "granularity": 65536,
   2966        "persistent": false,
   2967        "recording": false
   2968      },
   2969      {
   2970        "busy": false,
   2971        "count": 458752,
   2972        "granularity": 65536,
   2973        "persistent": false,
   2974        "recording": true
   2975      },
   2976      {
   2977        "busy": true,
   2978        "count": 393216,
   2979        "granularity": 65536,
   2980        "name": "bitmap0",
   2981        "persistent": false,
   2982        "recording": true
   2983      }
   2984    ]
   2985  }
   2986}
   2987
   2988= Checking Bitmap bitmap0 =
   2989expecting 6 dirty sectors; have 6. OK!
   2990
   2991= Checking Bitmap (anonymous) =
   2992expecting 7 dirty sectors; have 7. OK!
   2993
   2994{"execute": "job-cancel", "arguments": {"id": "backup_1"}}
   2995{"return": {}}
   2996{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2997{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   2998{
   2999  "bitmaps": {
   3000    "drive0": [
   3001      {
   3002        "busy": false,
   3003        "count": 458752,
   3004        "granularity": 65536,
   3005        "name": "bitmap0",
   3006        "persistent": false,
   3007        "recording": true
   3008      }
   3009    ]
   3010  }
   3011}
   3012
   3013= Checking Bitmap bitmap0 =
   3014expecting 7 dirty sectors; have 7. OK!
   3015
   3016--- Write #3 ---
   3017
   3018write -P0xaa 0x0010000 0x30000
   3019{"return": ""}
   3020write -P0xbb 0x00d8000 0x10000
   3021{"return": ""}
   3022write -P0xcc 0x2028000 0x10000
   3023{"return": ""}
   3024write -P0xdd 0x3fc0000 0x10000
   3025{"return": ""}
   3026{
   3027  "bitmaps": {
   3028    "drive0": [
   3029      {
   3030        "busy": false,
   3031        "count": 786432,
   3032        "granularity": 65536,
   3033        "name": "bitmap0",
   3034        "persistent": false,
   3035        "recording": true
   3036      }
   3037    ]
   3038  }
   3039}
   3040
   3041= Checking Bitmap bitmap0 =
   3042expecting 12 dirty sectors; have 12. OK!
   3043
   3044--- Reference Backup #2 ---
   3045
   3046{}
   3047{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3048{"return": {}}
   3049{}
   3050{}
   3051{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3052{"return": {}}
   3053{}
   3054{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   3055{"return": {}}
   3056{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3057
   3058--- Test Backup #2 ---
   3059
   3060{}
   3061{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3062{"return": {}}
   3063{}
   3064{}
   3065{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3066{"return": {}}
   3067{}
   3068{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   3069{"return": {}}
   3070{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   3071{"return": {}}
   3072{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3073{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3074{
   3075  "bitmaps": {
   3076    "drive0": [
   3077      {
   3078        "busy": false,
   3079        "count": 0,
   3080        "granularity": 65536,
   3081        "name": "bitmap0",
   3082        "persistent": false,
   3083        "recording": true
   3084      }
   3085    ]
   3086  }
   3087}
   3088
   3089= Checking Bitmap bitmap0 =
   3090expecting 0 dirty sectors; have 0. OK!
   3091
   3092--- Cleanup ---
   3093
   3094{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   3095{"return": {}}
   3096{
   3097  "bitmaps": {}
   3098}
   3099
   3100--- Verification ---
   3101
   3102qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   3103qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3104qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3105
   3106
   3107=== Mode full; Bitmap Sync always with intermediate failure ===
   3108
   3109--- Preparing image & VM ---
   3110
   3111{"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"}}
   3112{"return": {}}
   3113
   3114--- Write #0 ---
   3115
   3116write -P0x49 0x0000000 0x10000
   3117{"return": ""}
   3118write -P0x6c 0x0100000 0x10000
   3119{"return": ""}
   3120write -P0x6f 0x2000000 0x10000
   3121{"return": ""}
   3122write -P0x76 0x3ff0000 0x10000
   3123{"return": ""}
   3124{
   3125  "bitmaps": {}
   3126}
   3127
   3128--- Reference Backup #0 ---
   3129
   3130{}
   3131{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3132{"return": {}}
   3133{}
   3134{}
   3135{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3136{"return": {}}
   3137{}
   3138{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   3139{"return": {}}
   3140{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3141
   3142--- Add Bitmap ---
   3143
   3144{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   3145{"return": {}}
   3146
   3147--- Write #1 ---
   3148
   3149write -P0x65 0x0000000 0x10000
   3150{"return": ""}
   3151write -P0x77 0x00f8000 0x10000
   3152{"return": ""}
   3153write -P0x72 0x2008000 0x10000
   3154{"return": ""}
   3155write -P0x69 0x3fe0000 0x10000
   3156{"return": ""}
   3157{
   3158  "bitmaps": {
   3159    "drive0": [
   3160      {
   3161        "busy": false,
   3162        "count": 393216,
   3163        "granularity": 65536,
   3164        "name": "bitmap0",
   3165        "persistent": false,
   3166        "recording": true
   3167      }
   3168    ]
   3169  }
   3170}
   3171
   3172= Checking Bitmap bitmap0 =
   3173expecting 6 dirty sectors; have 6. OK!
   3174
   3175--- Reference Backup #1 ---
   3176
   3177{}
   3178{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3179{"return": {}}
   3180{}
   3181{}
   3182{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3183{"return": {}}
   3184{}
   3185{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   3186{"return": {}}
   3187{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3188
   3189{"return": ""}
   3190
   3191--- Test Backup #1 ---
   3192
   3193{}
   3194{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3195{"return": {}}
   3196{}
   3197{}
   3198{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3199{"return": {}}
   3200{}
   3201{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   3202{"return": {}}
   3203{"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3204{"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"}}
   3205{
   3206  "bitmaps": {
   3207    "drive0": [
   3208      {
   3209        "busy": false,
   3210        "count": 66125824,
   3211        "granularity": 65536,
   3212        "name": "bitmap0",
   3213        "persistent": false,
   3214        "recording": true
   3215      }
   3216    ]
   3217  }
   3218}
   3219
   3220= Checking Bitmap bitmap0 =
   3221expecting 1009 dirty sectors; have 1009. OK!
   3222
   3223--- Write #3 ---
   3224
   3225write -P0xaa 0x0010000 0x30000
   3226{"return": ""}
   3227write -P0xbb 0x00d8000 0x10000
   3228{"return": ""}
   3229write -P0xcc 0x2028000 0x10000
   3230{"return": ""}
   3231write -P0xdd 0x3fc0000 0x10000
   3232{"return": ""}
   3233{
   3234  "bitmaps": {
   3235    "drive0": [
   3236      {
   3237        "busy": false,
   3238        "count": 66453504,
   3239        "granularity": 65536,
   3240        "name": "bitmap0",
   3241        "persistent": false,
   3242        "recording": true
   3243      }
   3244    ]
   3245  }
   3246}
   3247
   3248= Checking Bitmap bitmap0 =
   3249expecting 1014 dirty sectors; have 1014. OK!
   3250
   3251--- Reference Backup #2 ---
   3252
   3253{}
   3254{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3255{"return": {}}
   3256{}
   3257{}
   3258{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3259{"return": {}}
   3260{}
   3261{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   3262{"return": {}}
   3263{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3264
   3265--- Test Backup #2 ---
   3266
   3267{}
   3268{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3269{"return": {}}
   3270{}
   3271{}
   3272{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3273{"return": {}}
   3274{}
   3275{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   3276{"return": {}}
   3277{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   3278{"return": {}}
   3279{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3280{"data": {"device": "backup_2", "len": 66453504, "offset": 66453504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3281{
   3282  "bitmaps": {
   3283    "drive0": [
   3284      {
   3285        "busy": false,
   3286        "count": 0,
   3287        "granularity": 65536,
   3288        "name": "bitmap0",
   3289        "persistent": false,
   3290        "recording": true
   3291      }
   3292    ]
   3293  }
   3294}
   3295
   3296= Checking Bitmap bitmap0 =
   3297expecting 0 dirty sectors; have 0. OK!
   3298
   3299--- Cleanup ---
   3300
   3301{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   3302{"return": {}}
   3303{
   3304  "bitmaps": {}
   3305}
   3306
   3307--- Verification ---
   3308
   3309qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
   3310qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3311qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3312
   3313
   3314=== Mode full; Bitmap Sync always without failure ===
   3315
   3316--- Preparing image & VM ---
   3317
   3318{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   3319{"return": {}}
   3320
   3321--- Write #0 ---
   3322
   3323write -P0x49 0x0000000 0x10000
   3324{"return": ""}
   3325write -P0x6c 0x0100000 0x10000
   3326{"return": ""}
   3327write -P0x6f 0x2000000 0x10000
   3328{"return": ""}
   3329write -P0x76 0x3ff0000 0x10000
   3330{"return": ""}
   3331{
   3332  "bitmaps": {}
   3333}
   3334
   3335--- Reference Backup #0 ---
   3336
   3337{}
   3338{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3339{"return": {}}
   3340{}
   3341{}
   3342{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3343{"return": {}}
   3344{}
   3345{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   3346{"return": {}}
   3347{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3348
   3349--- Add Bitmap ---
   3350
   3351{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   3352{"return": {}}
   3353
   3354--- Write #1 ---
   3355
   3356write -P0x65 0x0000000 0x10000
   3357{"return": ""}
   3358write -P0x77 0x00f8000 0x10000
   3359{"return": ""}
   3360write -P0x72 0x2008000 0x10000
   3361{"return": ""}
   3362write -P0x69 0x3fe0000 0x10000
   3363{"return": ""}
   3364{
   3365  "bitmaps": {
   3366    "drive0": [
   3367      {
   3368        "busy": false,
   3369        "count": 393216,
   3370        "granularity": 65536,
   3371        "name": "bitmap0",
   3372        "persistent": false,
   3373        "recording": true
   3374      }
   3375    ]
   3376  }
   3377}
   3378
   3379= Checking Bitmap bitmap0 =
   3380expecting 6 dirty sectors; have 6. OK!
   3381
   3382--- Reference Backup #1 ---
   3383
   3384{}
   3385{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3386{"return": {}}
   3387{}
   3388{}
   3389{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3390{"return": {}}
   3391{}
   3392{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   3393{"return": {}}
   3394{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3395
   3396--- Test Backup #1 ---
   3397
   3398{}
   3399{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3400{"return": {}}
   3401{}
   3402{}
   3403{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3404{"return": {}}
   3405{}
   3406{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "full", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   3407{"return": {}}
   3408
   3409--- Write #2 ---
   3410
   3411write -P0x74 0x0010000 0x10000
   3412{"return": ""}
   3413write -P0x69 0x00e8000 0x10000
   3414{"return": ""}
   3415write -P0x6e 0x2018000 0x10000
   3416{"return": ""}
   3417write -P0x67 0x3fe0000 0x20000
   3418{"return": ""}
   3419{
   3420  "bitmaps": {
   3421    "drive0": [
   3422      {
   3423        "busy": false,
   3424        "count": 0,
   3425        "granularity": 65536,
   3426        "persistent": false,
   3427        "recording": false
   3428      },
   3429      {
   3430        "busy": false,
   3431        "count": 458752,
   3432        "granularity": 65536,
   3433        "persistent": false,
   3434        "recording": true
   3435      },
   3436      {
   3437        "busy": true,
   3438        "count": 393216,
   3439        "granularity": 65536,
   3440        "name": "bitmap0",
   3441        "persistent": false,
   3442        "recording": true
   3443      }
   3444    ]
   3445  }
   3446}
   3447
   3448= Checking Bitmap bitmap0 =
   3449expecting 6 dirty sectors; have 6. OK!
   3450
   3451= Checking Bitmap (anonymous) =
   3452expecting 7 dirty sectors; have 7. OK!
   3453
   3454{"execute": "job-finalize", "arguments": {"id": "backup_1"}}
   3455{"return": {}}
   3456{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3457{"data": {"device": "backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3458{
   3459  "bitmaps": {
   3460    "drive0": [
   3461      {
   3462        "busy": false,
   3463        "count": 458752,
   3464        "granularity": 65536,
   3465        "name": "bitmap0",
   3466        "persistent": false,
   3467        "recording": true
   3468      }
   3469    ]
   3470  }
   3471}
   3472
   3473= Checking Bitmap bitmap0 =
   3474expecting 7 dirty sectors; have 7. OK!
   3475
   3476--- Write #3 ---
   3477
   3478write -P0xaa 0x0010000 0x30000
   3479{"return": ""}
   3480write -P0xbb 0x00d8000 0x10000
   3481{"return": ""}
   3482write -P0xcc 0x2028000 0x10000
   3483{"return": ""}
   3484write -P0xdd 0x3fc0000 0x10000
   3485{"return": ""}
   3486{
   3487  "bitmaps": {
   3488    "drive0": [
   3489      {
   3490        "busy": false,
   3491        "count": 786432,
   3492        "granularity": 65536,
   3493        "name": "bitmap0",
   3494        "persistent": false,
   3495        "recording": true
   3496      }
   3497    ]
   3498  }
   3499}
   3500
   3501= Checking Bitmap bitmap0 =
   3502expecting 12 dirty sectors; have 12. OK!
   3503
   3504--- Reference Backup #2 ---
   3505
   3506{}
   3507{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3508{"return": {}}
   3509{}
   3510{}
   3511{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3512{"return": {}}
   3513{}
   3514{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   3515{"return": {}}
   3516{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3517
   3518--- Test Backup #2 ---
   3519
   3520{}
   3521{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3522{"return": {}}
   3523{}
   3524{}
   3525{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3526{"return": {}}
   3527{}
   3528{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   3529{"return": {}}
   3530{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   3531{"return": {}}
   3532{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3533{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3534{
   3535  "bitmaps": {
   3536    "drive0": [
   3537      {
   3538        "busy": false,
   3539        "count": 0,
   3540        "granularity": 65536,
   3541        "name": "bitmap0",
   3542        "persistent": false,
   3543        "recording": true
   3544      }
   3545    ]
   3546  }
   3547}
   3548
   3549= Checking Bitmap bitmap0 =
   3550expecting 0 dirty sectors; have 0. OK!
   3551
   3552--- Cleanup ---
   3553
   3554{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   3555{"return": {}}
   3556{
   3557  "bitmaps": {}
   3558}
   3559
   3560--- Verification ---
   3561
   3562qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   3563qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3564qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3565
   3566
   3567=== Mode top; Bitmap Sync on-success with simulated failure ===
   3568
   3569--- Preparing image & VM ---
   3570
   3571{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   3572{"return": {}}
   3573
   3574--- Write #0 ---
   3575
   3576write -P0x49 0x0000000 0x10000
   3577{"return": ""}
   3578write -P0x6c 0x0100000 0x10000
   3579{"return": ""}
   3580write -P0x6f 0x2000000 0x10000
   3581{"return": ""}
   3582write -P0x76 0x3ff0000 0x10000
   3583{"return": ""}
   3584{
   3585  "bitmaps": {}
   3586}
   3587
   3588--- Reference Backup #0 ---
   3589
   3590{}
   3591{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3592{"return": {}}
   3593{}
   3594{}
   3595{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3596{"return": {}}
   3597{}
   3598{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   3599{"return": {}}
   3600{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3601
   3602--- Add Bitmap ---
   3603
   3604{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   3605{"return": {}}
   3606
   3607--- Write #1 ---
   3608
   3609write -P0x65 0x0000000 0x10000
   3610{"return": ""}
   3611write -P0x77 0x00f8000 0x10000
   3612{"return": ""}
   3613write -P0x72 0x2008000 0x10000
   3614{"return": ""}
   3615write -P0x69 0x3fe0000 0x10000
   3616{"return": ""}
   3617{
   3618  "bitmaps": {
   3619    "drive0": [
   3620      {
   3621        "busy": false,
   3622        "count": 393216,
   3623        "granularity": 65536,
   3624        "name": "bitmap0",
   3625        "persistent": false,
   3626        "recording": true
   3627      }
   3628    ]
   3629  }
   3630}
   3631
   3632= Checking Bitmap bitmap0 =
   3633expecting 6 dirty sectors; have 6. OK!
   3634
   3635--- Reference Backup #1 ---
   3636
   3637{}
   3638{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3639{"return": {}}
   3640{}
   3641{}
   3642{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3643{"return": {}}
   3644{}
   3645{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   3646{"return": {}}
   3647{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3648
   3649--- Test Backup #1 ---
   3650
   3651{}
   3652{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3653{"return": {}}
   3654{}
   3655{}
   3656{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3657{"return": {}}
   3658{}
   3659{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   3660{"return": {}}
   3661
   3662--- Write #2 ---
   3663
   3664write -P0x74 0x0010000 0x10000
   3665{"return": ""}
   3666write -P0x69 0x00e8000 0x10000
   3667{"return": ""}
   3668write -P0x6e 0x2018000 0x10000
   3669{"return": ""}
   3670write -P0x67 0x3fe0000 0x20000
   3671{"return": ""}
   3672{
   3673  "bitmaps": {
   3674    "drive0": [
   3675      {
   3676        "busy": false,
   3677        "count": 0,
   3678        "granularity": 65536,
   3679        "persistent": false,
   3680        "recording": false
   3681      },
   3682      {
   3683        "busy": false,
   3684        "count": 458752,
   3685        "granularity": 65536,
   3686        "persistent": false,
   3687        "recording": true
   3688      },
   3689      {
   3690        "busy": true,
   3691        "count": 393216,
   3692        "granularity": 65536,
   3693        "name": "bitmap0",
   3694        "persistent": false,
   3695        "recording": true
   3696      }
   3697    ]
   3698  }
   3699}
   3700
   3701= Checking Bitmap bitmap0 =
   3702expecting 6 dirty sectors; have 6. OK!
   3703
   3704= Checking Bitmap (anonymous) =
   3705expecting 7 dirty sectors; have 7. OK!
   3706
   3707{"execute": "job-cancel", "arguments": {"id": "backup_1"}}
   3708{"return": {}}
   3709{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3710{"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3711{
   3712  "bitmaps": {
   3713    "drive0": [
   3714      {
   3715        "busy": false,
   3716        "count": 655360,
   3717        "granularity": 65536,
   3718        "name": "bitmap0",
   3719        "persistent": false,
   3720        "recording": true
   3721      }
   3722    ]
   3723  }
   3724}
   3725
   3726= Checking Bitmap bitmap0 =
   3727expecting 10 dirty sectors; have 10. OK!
   3728
   3729--- Write #3 ---
   3730
   3731write -P0xaa 0x0010000 0x30000
   3732{"return": ""}
   3733write -P0xbb 0x00d8000 0x10000
   3734{"return": ""}
   3735write -P0xcc 0x2028000 0x10000
   3736{"return": ""}
   3737write -P0xdd 0x3fc0000 0x10000
   3738{"return": ""}
   3739{
   3740  "bitmaps": {
   3741    "drive0": [
   3742      {
   3743        "busy": false,
   3744        "count": 983040,
   3745        "granularity": 65536,
   3746        "name": "bitmap0",
   3747        "persistent": false,
   3748        "recording": true
   3749      }
   3750    ]
   3751  }
   3752}
   3753
   3754= Checking Bitmap bitmap0 =
   3755expecting 15 dirty sectors; have 15. OK!
   3756
   3757--- Reference Backup #2 ---
   3758
   3759{}
   3760{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3761{"return": {}}
   3762{}
   3763{}
   3764{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3765{"return": {}}
   3766{}
   3767{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   3768{"return": {}}
   3769{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3770
   3771--- Test Backup #2 ---
   3772
   3773{}
   3774{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3775{"return": {}}
   3776{}
   3777{}
   3778{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3779{"return": {}}
   3780{}
   3781{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   3782{"return": {}}
   3783{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   3784{"return": {}}
   3785{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3786{"data": {"device": "backup_2", "len": 983040, "offset": 983040, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3787{
   3788  "bitmaps": {
   3789    "drive0": [
   3790      {
   3791        "busy": false,
   3792        "count": 0,
   3793        "granularity": 65536,
   3794        "name": "bitmap0",
   3795        "persistent": false,
   3796        "recording": true
   3797      }
   3798    ]
   3799  }
   3800}
   3801
   3802= Checking Bitmap bitmap0 =
   3803expecting 0 dirty sectors; have 0. OK!
   3804
   3805--- Cleanup ---
   3806
   3807{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   3808{"return": {}}
   3809{
   3810  "bitmaps": {}
   3811}
   3812
   3813--- Verification ---
   3814
   3815qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   3816qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3817qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   3818
   3819
   3820=== Mode top; Bitmap Sync on-success with intermediate failure ===
   3821
   3822--- Preparing image & VM ---
   3823
   3824{"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"}}
   3825{"return": {}}
   3826
   3827--- Write #0 ---
   3828
   3829write -P0x49 0x0000000 0x10000
   3830{"return": ""}
   3831write -P0x6c 0x0100000 0x10000
   3832{"return": ""}
   3833write -P0x6f 0x2000000 0x10000
   3834{"return": ""}
   3835write -P0x76 0x3ff0000 0x10000
   3836{"return": ""}
   3837{
   3838  "bitmaps": {}
   3839}
   3840
   3841--- Reference Backup #0 ---
   3842
   3843{}
   3844{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3845{"return": {}}
   3846{}
   3847{}
   3848{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3849{"return": {}}
   3850{}
   3851{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   3852{"return": {}}
   3853{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3854
   3855--- Add Bitmap ---
   3856
   3857{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   3858{"return": {}}
   3859
   3860--- Write #1 ---
   3861
   3862write -P0x65 0x0000000 0x10000
   3863{"return": ""}
   3864write -P0x77 0x00f8000 0x10000
   3865{"return": ""}
   3866write -P0x72 0x2008000 0x10000
   3867{"return": ""}
   3868write -P0x69 0x3fe0000 0x10000
   3869{"return": ""}
   3870{
   3871  "bitmaps": {
   3872    "drive0": [
   3873      {
   3874        "busy": false,
   3875        "count": 393216,
   3876        "granularity": 65536,
   3877        "name": "bitmap0",
   3878        "persistent": false,
   3879        "recording": true
   3880      }
   3881    ]
   3882  }
   3883}
   3884
   3885= Checking Bitmap bitmap0 =
   3886expecting 6 dirty sectors; have 6. OK!
   3887
   3888--- Reference Backup #1 ---
   3889
   3890{}
   3891{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3892{"return": {}}
   3893{}
   3894{}
   3895{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3896{"return": {}}
   3897{}
   3898{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   3899{"return": {}}
   3900{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3901
   3902{"return": ""}
   3903
   3904--- Test Backup #1 ---
   3905
   3906{}
   3907{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3908{"return": {}}
   3909{}
   3910{}
   3911{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3912{"return": {}}
   3913{}
   3914{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   3915{"return": {}}
   3916{"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3917{"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"}}
   3918{
   3919  "bitmaps": {
   3920    "drive0": [
   3921      {
   3922        "busy": false,
   3923        "count": 393216,
   3924        "granularity": 65536,
   3925        "name": "bitmap0",
   3926        "persistent": false,
   3927        "recording": true
   3928      }
   3929    ]
   3930  }
   3931}
   3932
   3933= Checking Bitmap bitmap0 =
   3934expecting 6 dirty sectors; have 6. OK!
   3935
   3936--- Write #3 ---
   3937
   3938write -P0xaa 0x0010000 0x30000
   3939{"return": ""}
   3940write -P0xbb 0x00d8000 0x10000
   3941{"return": ""}
   3942write -P0xcc 0x2028000 0x10000
   3943{"return": ""}
   3944write -P0xdd 0x3fc0000 0x10000
   3945{"return": ""}
   3946{
   3947  "bitmaps": {
   3948    "drive0": [
   3949      {
   3950        "busy": false,
   3951        "count": 917504,
   3952        "granularity": 65536,
   3953        "name": "bitmap0",
   3954        "persistent": false,
   3955        "recording": true
   3956      }
   3957    ]
   3958  }
   3959}
   3960
   3961= Checking Bitmap bitmap0 =
   3962expecting 14 dirty sectors; have 14. OK!
   3963
   3964--- Reference Backup #2 ---
   3965
   3966{}
   3967{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3968{"return": {}}
   3969{}
   3970{}
   3971{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3972{"return": {}}
   3973{}
   3974{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   3975{"return": {}}
   3976{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3977
   3978--- Test Backup #2 ---
   3979
   3980{}
   3981{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   3982{"return": {}}
   3983{}
   3984{}
   3985{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   3986{"return": {}}
   3987{}
   3988{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   3989{"return": {}}
   3990{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   3991{"return": {}}
   3992{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3993{"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   3994{
   3995  "bitmaps": {
   3996    "drive0": [
   3997      {
   3998        "busy": false,
   3999        "count": 0,
   4000        "granularity": 65536,
   4001        "name": "bitmap0",
   4002        "persistent": false,
   4003        "recording": true
   4004      }
   4005    ]
   4006  }
   4007}
   4008
   4009= Checking Bitmap bitmap0 =
   4010expecting 0 dirty sectors; have 0. OK!
   4011
   4012--- Cleanup ---
   4013
   4014{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   4015{"return": {}}
   4016{
   4017  "bitmaps": {}
   4018}
   4019
   4020--- Verification ---
   4021
   4022qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
   4023qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4024qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4025
   4026
   4027=== Mode top; Bitmap Sync on-success without failure ===
   4028
   4029--- Preparing image & VM ---
   4030
   4031{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   4032{"return": {}}
   4033
   4034--- Write #0 ---
   4035
   4036write -P0x49 0x0000000 0x10000
   4037{"return": ""}
   4038write -P0x6c 0x0100000 0x10000
   4039{"return": ""}
   4040write -P0x6f 0x2000000 0x10000
   4041{"return": ""}
   4042write -P0x76 0x3ff0000 0x10000
   4043{"return": ""}
   4044{
   4045  "bitmaps": {}
   4046}
   4047
   4048--- Reference Backup #0 ---
   4049
   4050{}
   4051{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4052{"return": {}}
   4053{}
   4054{}
   4055{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4056{"return": {}}
   4057{}
   4058{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   4059{"return": {}}
   4060{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4061
   4062--- Add Bitmap ---
   4063
   4064{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   4065{"return": {}}
   4066
   4067--- Write #1 ---
   4068
   4069write -P0x65 0x0000000 0x10000
   4070{"return": ""}
   4071write -P0x77 0x00f8000 0x10000
   4072{"return": ""}
   4073write -P0x72 0x2008000 0x10000
   4074{"return": ""}
   4075write -P0x69 0x3fe0000 0x10000
   4076{"return": ""}
   4077{
   4078  "bitmaps": {
   4079    "drive0": [
   4080      {
   4081        "busy": false,
   4082        "count": 393216,
   4083        "granularity": 65536,
   4084        "name": "bitmap0",
   4085        "persistent": false,
   4086        "recording": true
   4087      }
   4088    ]
   4089  }
   4090}
   4091
   4092= Checking Bitmap bitmap0 =
   4093expecting 6 dirty sectors; have 6. OK!
   4094
   4095--- Reference Backup #1 ---
   4096
   4097{}
   4098{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4099{"return": {}}
   4100{}
   4101{}
   4102{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4103{"return": {}}
   4104{}
   4105{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   4106{"return": {}}
   4107{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4108
   4109--- Test Backup #1 ---
   4110
   4111{}
   4112{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4113{"return": {}}
   4114{}
   4115{}
   4116{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4117{"return": {}}
   4118{}
   4119{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   4120{"return": {}}
   4121
   4122--- Write #2 ---
   4123
   4124write -P0x74 0x0010000 0x10000
   4125{"return": ""}
   4126write -P0x69 0x00e8000 0x10000
   4127{"return": ""}
   4128write -P0x6e 0x2018000 0x10000
   4129{"return": ""}
   4130write -P0x67 0x3fe0000 0x20000
   4131{"return": ""}
   4132{
   4133  "bitmaps": {
   4134    "drive0": [
   4135      {
   4136        "busy": false,
   4137        "count": 0,
   4138        "granularity": 65536,
   4139        "persistent": false,
   4140        "recording": false
   4141      },
   4142      {
   4143        "busy": false,
   4144        "count": 458752,
   4145        "granularity": 65536,
   4146        "persistent": false,
   4147        "recording": true
   4148      },
   4149      {
   4150        "busy": true,
   4151        "count": 393216,
   4152        "granularity": 65536,
   4153        "name": "bitmap0",
   4154        "persistent": false,
   4155        "recording": true
   4156      }
   4157    ]
   4158  }
   4159}
   4160
   4161= Checking Bitmap bitmap0 =
   4162expecting 6 dirty sectors; have 6. OK!
   4163
   4164= Checking Bitmap (anonymous) =
   4165expecting 7 dirty sectors; have 7. OK!
   4166
   4167{"execute": "job-finalize", "arguments": {"id": "backup_1"}}
   4168{"return": {}}
   4169{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4170{"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4171{
   4172  "bitmaps": {
   4173    "drive0": [
   4174      {
   4175        "busy": false,
   4176        "count": 458752,
   4177        "granularity": 65536,
   4178        "name": "bitmap0",
   4179        "persistent": false,
   4180        "recording": true
   4181      }
   4182    ]
   4183  }
   4184}
   4185
   4186= Checking Bitmap bitmap0 =
   4187expecting 7 dirty sectors; have 7. OK!
   4188
   4189--- Write #3 ---
   4190
   4191write -P0xaa 0x0010000 0x30000
   4192{"return": ""}
   4193write -P0xbb 0x00d8000 0x10000
   4194{"return": ""}
   4195write -P0xcc 0x2028000 0x10000
   4196{"return": ""}
   4197write -P0xdd 0x3fc0000 0x10000
   4198{"return": ""}
   4199{
   4200  "bitmaps": {
   4201    "drive0": [
   4202      {
   4203        "busy": false,
   4204        "count": 786432,
   4205        "granularity": 65536,
   4206        "name": "bitmap0",
   4207        "persistent": false,
   4208        "recording": true
   4209      }
   4210    ]
   4211  }
   4212}
   4213
   4214= Checking Bitmap bitmap0 =
   4215expecting 12 dirty sectors; have 12. OK!
   4216
   4217--- Reference Backup #2 ---
   4218
   4219{}
   4220{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4221{"return": {}}
   4222{}
   4223{}
   4224{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4225{"return": {}}
   4226{}
   4227{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   4228{"return": {}}
   4229{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4230
   4231--- Test Backup #2 ---
   4232
   4233{}
   4234{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4235{"return": {}}
   4236{}
   4237{}
   4238{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4239{"return": {}}
   4240{}
   4241{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   4242{"return": {}}
   4243{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   4244{"return": {}}
   4245{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4246{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4247{
   4248  "bitmaps": {
   4249    "drive0": [
   4250      {
   4251        "busy": false,
   4252        "count": 0,
   4253        "granularity": 65536,
   4254        "name": "bitmap0",
   4255        "persistent": false,
   4256        "recording": true
   4257      }
   4258    ]
   4259  }
   4260}
   4261
   4262= Checking Bitmap bitmap0 =
   4263expecting 0 dirty sectors; have 0. OK!
   4264
   4265--- Cleanup ---
   4266
   4267{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   4268{"return": {}}
   4269{
   4270  "bitmaps": {}
   4271}
   4272
   4273--- Verification ---
   4274
   4275qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   4276qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4277qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4278
   4279
   4280=== Mode top; Bitmap Sync always with simulated failure ===
   4281
   4282--- Preparing image & VM ---
   4283
   4284{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   4285{"return": {}}
   4286
   4287--- Write #0 ---
   4288
   4289write -P0x49 0x0000000 0x10000
   4290{"return": ""}
   4291write -P0x6c 0x0100000 0x10000
   4292{"return": ""}
   4293write -P0x6f 0x2000000 0x10000
   4294{"return": ""}
   4295write -P0x76 0x3ff0000 0x10000
   4296{"return": ""}
   4297{
   4298  "bitmaps": {}
   4299}
   4300
   4301--- Reference Backup #0 ---
   4302
   4303{}
   4304{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4305{"return": {}}
   4306{}
   4307{}
   4308{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4309{"return": {}}
   4310{}
   4311{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   4312{"return": {}}
   4313{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4314
   4315--- Add Bitmap ---
   4316
   4317{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   4318{"return": {}}
   4319
   4320--- Write #1 ---
   4321
   4322write -P0x65 0x0000000 0x10000
   4323{"return": ""}
   4324write -P0x77 0x00f8000 0x10000
   4325{"return": ""}
   4326write -P0x72 0x2008000 0x10000
   4327{"return": ""}
   4328write -P0x69 0x3fe0000 0x10000
   4329{"return": ""}
   4330{
   4331  "bitmaps": {
   4332    "drive0": [
   4333      {
   4334        "busy": false,
   4335        "count": 393216,
   4336        "granularity": 65536,
   4337        "name": "bitmap0",
   4338        "persistent": false,
   4339        "recording": true
   4340      }
   4341    ]
   4342  }
   4343}
   4344
   4345= Checking Bitmap bitmap0 =
   4346expecting 6 dirty sectors; have 6. OK!
   4347
   4348--- Reference Backup #1 ---
   4349
   4350{}
   4351{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4352{"return": {}}
   4353{}
   4354{}
   4355{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4356{"return": {}}
   4357{}
   4358{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   4359{"return": {}}
   4360{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4361
   4362--- Test Backup #1 ---
   4363
   4364{}
   4365{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4366{"return": {}}
   4367{}
   4368{}
   4369{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4370{"return": {}}
   4371{}
   4372{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   4373{"return": {}}
   4374
   4375--- Write #2 ---
   4376
   4377write -P0x74 0x0010000 0x10000
   4378{"return": ""}
   4379write -P0x69 0x00e8000 0x10000
   4380{"return": ""}
   4381write -P0x6e 0x2018000 0x10000
   4382{"return": ""}
   4383write -P0x67 0x3fe0000 0x20000
   4384{"return": ""}
   4385{
   4386  "bitmaps": {
   4387    "drive0": [
   4388      {
   4389        "busy": false,
   4390        "count": 0,
   4391        "granularity": 65536,
   4392        "persistent": false,
   4393        "recording": false
   4394      },
   4395      {
   4396        "busy": false,
   4397        "count": 458752,
   4398        "granularity": 65536,
   4399        "persistent": false,
   4400        "recording": true
   4401      },
   4402      {
   4403        "busy": true,
   4404        "count": 393216,
   4405        "granularity": 65536,
   4406        "name": "bitmap0",
   4407        "persistent": false,
   4408        "recording": true
   4409      }
   4410    ]
   4411  }
   4412}
   4413
   4414= Checking Bitmap bitmap0 =
   4415expecting 6 dirty sectors; have 6. OK!
   4416
   4417= Checking Bitmap (anonymous) =
   4418expecting 7 dirty sectors; have 7. OK!
   4419
   4420{"execute": "job-cancel", "arguments": {"id": "backup_1"}}
   4421{"return": {}}
   4422{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4423{"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4424{
   4425  "bitmaps": {
   4426    "drive0": [
   4427      {
   4428        "busy": false,
   4429        "count": 458752,
   4430        "granularity": 65536,
   4431        "name": "bitmap0",
   4432        "persistent": false,
   4433        "recording": true
   4434      }
   4435    ]
   4436  }
   4437}
   4438
   4439= Checking Bitmap bitmap0 =
   4440expecting 7 dirty sectors; have 7. OK!
   4441
   4442--- Write #3 ---
   4443
   4444write -P0xaa 0x0010000 0x30000
   4445{"return": ""}
   4446write -P0xbb 0x00d8000 0x10000
   4447{"return": ""}
   4448write -P0xcc 0x2028000 0x10000
   4449{"return": ""}
   4450write -P0xdd 0x3fc0000 0x10000
   4451{"return": ""}
   4452{
   4453  "bitmaps": {
   4454    "drive0": [
   4455      {
   4456        "busy": false,
   4457        "count": 786432,
   4458        "granularity": 65536,
   4459        "name": "bitmap0",
   4460        "persistent": false,
   4461        "recording": true
   4462      }
   4463    ]
   4464  }
   4465}
   4466
   4467= Checking Bitmap bitmap0 =
   4468expecting 12 dirty sectors; have 12. OK!
   4469
   4470--- Reference Backup #2 ---
   4471
   4472{}
   4473{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4474{"return": {}}
   4475{}
   4476{}
   4477{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4478{"return": {}}
   4479{}
   4480{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   4481{"return": {}}
   4482{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4483
   4484--- Test Backup #2 ---
   4485
   4486{}
   4487{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4488{"return": {}}
   4489{}
   4490{}
   4491{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4492{"return": {}}
   4493{}
   4494{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   4495{"return": {}}
   4496{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   4497{"return": {}}
   4498{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4499{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4500{
   4501  "bitmaps": {
   4502    "drive0": [
   4503      {
   4504        "busy": false,
   4505        "count": 0,
   4506        "granularity": 65536,
   4507        "name": "bitmap0",
   4508        "persistent": false,
   4509        "recording": true
   4510      }
   4511    ]
   4512  }
   4513}
   4514
   4515= Checking Bitmap bitmap0 =
   4516expecting 0 dirty sectors; have 0. OK!
   4517
   4518--- Cleanup ---
   4519
   4520{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   4521{"return": {}}
   4522{
   4523  "bitmaps": {}
   4524}
   4525
   4526--- Verification ---
   4527
   4528qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   4529qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4530qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4531
   4532
   4533=== Mode top; Bitmap Sync always with intermediate failure ===
   4534
   4535--- Preparing image & VM ---
   4536
   4537{"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"}}
   4538{"return": {}}
   4539
   4540--- Write #0 ---
   4541
   4542write -P0x49 0x0000000 0x10000
   4543{"return": ""}
   4544write -P0x6c 0x0100000 0x10000
   4545{"return": ""}
   4546write -P0x6f 0x2000000 0x10000
   4547{"return": ""}
   4548write -P0x76 0x3ff0000 0x10000
   4549{"return": ""}
   4550{
   4551  "bitmaps": {}
   4552}
   4553
   4554--- Reference Backup #0 ---
   4555
   4556{}
   4557{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4558{"return": {}}
   4559{}
   4560{}
   4561{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4562{"return": {}}
   4563{}
   4564{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   4565{"return": {}}
   4566{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4567
   4568--- Add Bitmap ---
   4569
   4570{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   4571{"return": {}}
   4572
   4573--- Write #1 ---
   4574
   4575write -P0x65 0x0000000 0x10000
   4576{"return": ""}
   4577write -P0x77 0x00f8000 0x10000
   4578{"return": ""}
   4579write -P0x72 0x2008000 0x10000
   4580{"return": ""}
   4581write -P0x69 0x3fe0000 0x10000
   4582{"return": ""}
   4583{
   4584  "bitmaps": {
   4585    "drive0": [
   4586      {
   4587        "busy": false,
   4588        "count": 393216,
   4589        "granularity": 65536,
   4590        "name": "bitmap0",
   4591        "persistent": false,
   4592        "recording": true
   4593      }
   4594    ]
   4595  }
   4596}
   4597
   4598= Checking Bitmap bitmap0 =
   4599expecting 6 dirty sectors; have 6. OK!
   4600
   4601--- Reference Backup #1 ---
   4602
   4603{}
   4604{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4605{"return": {}}
   4606{}
   4607{}
   4608{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4609{"return": {}}
   4610{}
   4611{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   4612{"return": {}}
   4613{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4614
   4615{"return": ""}
   4616
   4617--- Test Backup #1 ---
   4618
   4619{}
   4620{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4621{"return": {}}
   4622{}
   4623{}
   4624{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4625{"return": {}}
   4626{}
   4627{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   4628{"return": {}}
   4629{"data": {"action": "report", "device": "backup_1", "operation": "read"}, "event": "BLOCK_JOB_ERROR", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4630{"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"}}
   4631{
   4632  "bitmaps": {
   4633    "drive0": [
   4634      {
   4635        "busy": false,
   4636        "count": 393216,
   4637        "granularity": 65536,
   4638        "name": "bitmap0",
   4639        "persistent": false,
   4640        "recording": true
   4641      }
   4642    ]
   4643  }
   4644}
   4645
   4646= Checking Bitmap bitmap0 =
   4647expecting 6 dirty sectors; have 6. OK!
   4648
   4649--- Write #3 ---
   4650
   4651write -P0xaa 0x0010000 0x30000
   4652{"return": ""}
   4653write -P0xbb 0x00d8000 0x10000
   4654{"return": ""}
   4655write -P0xcc 0x2028000 0x10000
   4656{"return": ""}
   4657write -P0xdd 0x3fc0000 0x10000
   4658{"return": ""}
   4659{
   4660  "bitmaps": {
   4661    "drive0": [
   4662      {
   4663        "busy": false,
   4664        "count": 917504,
   4665        "granularity": 65536,
   4666        "name": "bitmap0",
   4667        "persistent": false,
   4668        "recording": true
   4669      }
   4670    ]
   4671  }
   4672}
   4673
   4674= Checking Bitmap bitmap0 =
   4675expecting 14 dirty sectors; have 14. OK!
   4676
   4677--- Reference Backup #2 ---
   4678
   4679{}
   4680{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4681{"return": {}}
   4682{}
   4683{}
   4684{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4685{"return": {}}
   4686{}
   4687{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   4688{"return": {}}
   4689{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4690
   4691--- Test Backup #2 ---
   4692
   4693{}
   4694{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4695{"return": {}}
   4696{}
   4697{}
   4698{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4699{"return": {}}
   4700{}
   4701{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   4702{"return": {}}
   4703{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   4704{"return": {}}
   4705{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4706{"data": {"device": "backup_2", "len": 917504, "offset": 917504, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4707{
   4708  "bitmaps": {
   4709    "drive0": [
   4710      {
   4711        "busy": false,
   4712        "count": 0,
   4713        "granularity": 65536,
   4714        "name": "bitmap0",
   4715        "persistent": false,
   4716        "recording": true
   4717      }
   4718    ]
   4719  }
   4720}
   4721
   4722= Checking Bitmap bitmap0 =
   4723expecting 0 dirty sectors; have 0. OK!
   4724
   4725--- Cleanup ---
   4726
   4727{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   4728{"return": {}}
   4729{
   4730  "bitmaps": {}
   4731}
   4732
   4733--- Verification ---
   4734
   4735qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Mismatch, OK!
   4736qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4737qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4738
   4739
   4740=== Mode top; Bitmap Sync always without failure ===
   4741
   4742--- Preparing image & VM ---
   4743
   4744{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   4745{"return": {}}
   4746
   4747--- Write #0 ---
   4748
   4749write -P0x49 0x0000000 0x10000
   4750{"return": ""}
   4751write -P0x6c 0x0100000 0x10000
   4752{"return": ""}
   4753write -P0x6f 0x2000000 0x10000
   4754{"return": ""}
   4755write -P0x76 0x3ff0000 0x10000
   4756{"return": ""}
   4757{
   4758  "bitmaps": {}
   4759}
   4760
   4761--- Reference Backup #0 ---
   4762
   4763{}
   4764{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4765{"return": {}}
   4766{}
   4767{}
   4768{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4769{"return": {}}
   4770{}
   4771{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_0", "sync": "full", "target": "ref_target_0", "x-perf": {"max-workers": 1}}}
   4772{"return": {}}
   4773{"data": {"device": "ref_backup_0", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4774
   4775--- Add Bitmap ---
   4776
   4777{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   4778{"return": {}}
   4779
   4780--- Write #1 ---
   4781
   4782write -P0x65 0x0000000 0x10000
   4783{"return": ""}
   4784write -P0x77 0x00f8000 0x10000
   4785{"return": ""}
   4786write -P0x72 0x2008000 0x10000
   4787{"return": ""}
   4788write -P0x69 0x3fe0000 0x10000
   4789{"return": ""}
   4790{
   4791  "bitmaps": {
   4792    "drive0": [
   4793      {
   4794        "busy": false,
   4795        "count": 393216,
   4796        "granularity": 65536,
   4797        "name": "bitmap0",
   4798        "persistent": false,
   4799        "recording": true
   4800      }
   4801    ]
   4802  }
   4803}
   4804
   4805= Checking Bitmap bitmap0 =
   4806expecting 6 dirty sectors; have 6. OK!
   4807
   4808--- Reference Backup #1 ---
   4809
   4810{}
   4811{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4812{"return": {}}
   4813{}
   4814{}
   4815{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4816{"return": {}}
   4817{}
   4818{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_1", "sync": "full", "target": "ref_target_1", "x-perf": {"max-workers": 1}}}
   4819{"return": {}}
   4820{"data": {"device": "ref_backup_1", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4821
   4822--- Test Backup #1 ---
   4823
   4824{}
   4825{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4826{"return": {}}
   4827{}
   4828{}
   4829{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4830{"return": {}}
   4831{}
   4832{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_1", "sync": "top", "target": "backup_target_1", "x-perf": {"max-workers": 1}}}
   4833{"return": {}}
   4834
   4835--- Write #2 ---
   4836
   4837write -P0x74 0x0010000 0x10000
   4838{"return": ""}
   4839write -P0x69 0x00e8000 0x10000
   4840{"return": ""}
   4841write -P0x6e 0x2018000 0x10000
   4842{"return": ""}
   4843write -P0x67 0x3fe0000 0x20000
   4844{"return": ""}
   4845{
   4846  "bitmaps": {
   4847    "drive0": [
   4848      {
   4849        "busy": false,
   4850        "count": 0,
   4851        "granularity": 65536,
   4852        "persistent": false,
   4853        "recording": false
   4854      },
   4855      {
   4856        "busy": false,
   4857        "count": 458752,
   4858        "granularity": 65536,
   4859        "persistent": false,
   4860        "recording": true
   4861      },
   4862      {
   4863        "busy": true,
   4864        "count": 393216,
   4865        "granularity": 65536,
   4866        "name": "bitmap0",
   4867        "persistent": false,
   4868        "recording": true
   4869      }
   4870    ]
   4871  }
   4872}
   4873
   4874= Checking Bitmap bitmap0 =
   4875expecting 6 dirty sectors; have 6. OK!
   4876
   4877= Checking Bitmap (anonymous) =
   4878expecting 7 dirty sectors; have 7. OK!
   4879
   4880{"execute": "job-finalize", "arguments": {"id": "backup_1"}}
   4881{"return": {}}
   4882{"data": {"id": "backup_1", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4883{"data": {"device": "backup_1", "len": 458752, "offset": 458752, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4884{
   4885  "bitmaps": {
   4886    "drive0": [
   4887      {
   4888        "busy": false,
   4889        "count": 458752,
   4890        "granularity": 65536,
   4891        "name": "bitmap0",
   4892        "persistent": false,
   4893        "recording": true
   4894      }
   4895    ]
   4896  }
   4897}
   4898
   4899= Checking Bitmap bitmap0 =
   4900expecting 7 dirty sectors; have 7. OK!
   4901
   4902--- Write #3 ---
   4903
   4904write -P0xaa 0x0010000 0x30000
   4905{"return": ""}
   4906write -P0xbb 0x00d8000 0x10000
   4907{"return": ""}
   4908write -P0xcc 0x2028000 0x10000
   4909{"return": ""}
   4910write -P0xdd 0x3fc0000 0x10000
   4911{"return": ""}
   4912{
   4913  "bitmaps": {
   4914    "drive0": [
   4915      {
   4916        "busy": false,
   4917        "count": 786432,
   4918        "granularity": 65536,
   4919        "name": "bitmap0",
   4920        "persistent": false,
   4921        "recording": true
   4922      }
   4923    ]
   4924  }
   4925}
   4926
   4927= Checking Bitmap bitmap0 =
   4928expecting 12 dirty sectors; have 12. OK!
   4929
   4930--- Reference Backup #2 ---
   4931
   4932{}
   4933{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4934{"return": {}}
   4935{}
   4936{}
   4937{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4938{"return": {}}
   4939{}
   4940{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "ref_backup_2", "sync": "full", "target": "ref_target_2", "x-perf": {"max-workers": 1}}}
   4941{"return": {}}
   4942{"data": {"device": "ref_backup_2", "len": 67108864, "offset": 67108864, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4943
   4944--- Test Backup #2 ---
   4945
   4946{}
   4947{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   4948{"return": {}}
   4949{}
   4950{}
   4951{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   4952{"return": {}}
   4953{}
   4954{"execute": "blockdev-backup", "arguments": {"auto-finalize": false, "bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "backup_2", "sync": "bitmap", "target": "backup_target_2", "x-perf": {"max-workers": 1}}}
   4955{"return": {}}
   4956{"execute": "job-finalize", "arguments": {"id": "backup_2"}}
   4957{"return": {}}
   4958{"data": {"id": "backup_2", "type": "backup"}, "event": "BLOCK_JOB_PENDING", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4959{"data": {"device": "backup_2", "len": 786432, "offset": 786432, "speed": 0, "type": "backup"}, "event": "BLOCK_JOB_COMPLETED", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}}
   4960{
   4961  "bitmaps": {
   4962    "drive0": [
   4963      {
   4964        "busy": false,
   4965        "count": 0,
   4966        "granularity": 65536,
   4967        "name": "bitmap0",
   4968        "persistent": false,
   4969        "recording": true
   4970      }
   4971    ]
   4972  }
   4973}
   4974
   4975= Checking Bitmap bitmap0 =
   4976expecting 0 dirty sectors; have 0. OK!
   4977
   4978--- Cleanup ---
   4979
   4980{"execute": "block-dirty-bitmap-remove", "arguments": {"name": "bitmap0", "node": "drive0"}}
   4981{"return": {}}
   4982{
   4983  "bitmaps": {}
   4984}
   4985
   4986--- Verification ---
   4987
   4988qemu_img compare "TEST_DIR/PID-bsync1" "TEST_DIR/PID-fbackup1" ==> Identical, OK!
   4989qemu_img compare "TEST_DIR/PID-bsync2" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4990qemu_img compare "TEST_DIR/PID-img" "TEST_DIR/PID-fbackup2" ==> Identical, OK!
   4991
   4992
   4993=== API failure tests ===
   4994
   4995--- Preparing image & VM ---
   4996
   4997{"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename": "TEST_DIR/PID-img"}, "node-name": "drive0"}}
   4998{"return": {}}
   4999
   5000{}
   5001{"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}}
   5002{"return": {}}
   5003{}
   5004{}
   5005{"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}}
   5006{"return": {}}
   5007{}
   5008
   5009{"execute": "block-dirty-bitmap-add", "arguments": {"granularity": 65536, "name": "bitmap0", "node": "drive0"}}
   5010{"return": {}}
   5011
   5012-- Testing invalid QMP commands --
   5013
   5014-- Sync mode incremental tests --
   5015
   5016{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5017{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
   5018
   5019{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5020{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
   5021
   5022{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5023{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
   5024
   5025{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5026{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'incremental' sync mode"}}
   5027
   5028{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5029{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5030
   5031{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5032{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
   5033
   5034{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5035{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
   5036
   5037{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5038{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5039
   5040{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5041{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
   5042
   5043{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "incremental", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5044{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be 'on-success' when using sync mode 'incremental'"}}
   5045
   5046-- Sync mode bitmap tests --
   5047
   5048{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5049{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
   5050
   5051{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5052{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
   5053
   5054{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5055{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
   5056
   5057{"execute": "blockdev-backup", "arguments": {"device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5058{"error": {"class": "GenericError", "desc": "must provide a valid bitmap name for 'bitmap' sync mode"}}
   5059
   5060{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5061{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5062
   5063{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5064{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5065
   5066{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5067{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5068
   5069{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5070{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5071
   5072{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "bitmap", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5073{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}
   5074
   5075-- Sync mode full tests --
   5076
   5077{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5078{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5079
   5080{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5081{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5082
   5083{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5084{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5085
   5086{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5087{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5088
   5089{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5090{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5091
   5092{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5093{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5094
   5095{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5096{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5097
   5098{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5099{"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has no meaningful effect when combined with sync mode 'full'"}}
   5100
   5101{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "full", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5102{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}
   5103
   5104-- Sync mode top tests --
   5105
   5106{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5107{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5108
   5109{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5110{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5111
   5112{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5113{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5114
   5115{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5116{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5117
   5118{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5119{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5120
   5121{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5122{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5123
   5124{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5125{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5126
   5127{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5128{"error": {"class": "GenericError", "desc": "Bitmap sync mode 'never' has no meaningful effect when combined with sync mode 'top'"}}
   5129
   5130{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "top", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5131{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}
   5132
   5133-- Sync mode none tests --
   5134
   5135{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5136{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5137
   5138{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5139{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5140
   5141{"execute": "blockdev-backup", "arguments": {"bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5142{"error": {"class": "GenericError", "desc": "Cannot specify bitmap sync mode without a bitmap"}}
   5143
   5144{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5145{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5146
   5147{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5148{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5149
   5150{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5151{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5152
   5153{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap404", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5154{"error": {"class": "GenericError", "desc": "Bitmap 'bitmap404' could not be found"}}
   5155
   5156{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "on-success", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5157{"error": {"class": "GenericError", "desc": "sync mode 'none' does not produce meaningful bitmap outputs"}}
   5158
   5159{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "always", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5160{"error": {"class": "GenericError", "desc": "sync mode 'none' does not produce meaningful bitmap outputs"}}
   5161
   5162{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "bitmap-mode": "never", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5163{"error": {"class": "GenericError", "desc": "sync mode 'none' does not produce meaningful bitmap outputs"}}
   5164
   5165{"execute": "blockdev-backup", "arguments": {"bitmap": "bitmap0", "device": "drive0", "filter-node-name": "backup-top", "job-id": "api_job", "sync": "none", "target": "backup_target", "x-perf": {"max-workers": 1}}}
   5166{"error": {"class": "GenericError", "desc": "Bitmap sync mode must be given when providing a bitmap"}}
   5167