Hi, This is a new (very small) block job that writes a pattern into a bitmap. The only pattern implemented is the top allocation information.
This can be used to "recover" an incremental bitmap chain if an external snapshot was taken without creating a new bitmap first: any writes made to the image will be reflected by the allocation status and can be written back into a bitmap. This is useful for e.g. libvirt managing backup chains if a user creates an external snapshot outside of libvirt. Patches 1-2: The new job. Patch 3: iotest prerequisite Patch 4-5: completely optional cleanup. Patch 6: Test. John Snow (6): block: add bitmap-populate job qmp: expose block-dirty-bitmap-populate iotests: move bitmap helpers into their own file iotests: add hmp helper with logging qmp.py: change event_wait to use a dict iotests: add 287 for block-dirty-bitmap-populate qapi/block-core.json | 66 + qapi/job.json | 2 +- qapi/transaction.json | 2 + include/block/block_int.h | 21 + block/bitmap-alloc.c | 207 ++ blockdev.c | 78 + blockjob.c | 3 +- block/Makefile.objs | 1 + python/qemu/machine.py | 10 +- tests/qemu-iotests/040 | 12 +- tests/qemu-iotests/257 | 110 +- tests/qemu-iotests/260 | 5 +- tests/qemu-iotests/287 | 233 ++ tests/qemu-iotests/287.out | 4544 +++++++++++++++++++++++++++++++++ tests/qemu-iotests/bitmaps.py | 131 + tests/qemu-iotests/group | 1 + tests/qemu-iotests/iotests.py | 34 +- 17 files changed, 5321 insertions(+), 139 deletions(-) create mode 100644 block/bitmap-alloc.c create mode 100755 tests/qemu-iotests/287 create mode 100644 tests/qemu-iotests/287.out create mode 100644 tests/qemu-iotests/bitmaps.py -- 2.21.1