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. v2: - Addressed some, but not all feedback - Rebased on latest 'job-runner' series; but it's not clear if it should be kept. - This version doesn't address all of the feedback from v1, but I am posting it to the list as an RFC. John Snow (5): block: add bitmap-populate job blockdev: combine DriveBackupState and BlockdevBackupState qmp: expose block-dirty-bitmap-populate iotests: move bitmap helpers into their own file 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 | 104 +- blockjob.c | 3 +- block/Makefile.objs | 1 + tests/qemu-iotests/257 | 110 +- tests/qemu-iotests/287 | 242 ++ tests/qemu-iotests/287.out | 4544 +++++++++++++++++++++++++++++++++ tests/qemu-iotests/bitmaps.py | 131 + tests/qemu-iotests/group | 1 + 13 files changed, 5305 insertions(+), 129 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