When we are copying storage we should also preserve the block dirty bitmaps. This series implements their migration. For standard migration with shared storage we let qemu flush the bitmaps to disk and reload them on destination. There is possibility to migrate them using the migration stream too but it's not implemented in this series. Note that the first patch depends on the following qemu patches: https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg03659.html We can now also formulate the condition for enabling incremental backup feature, but it still depends on stabilization of 'blockdev-reopen'. Peter Krempa (19): qemucapabilitiesdata: Update test data for qemu-6.0 on x86_64 qemu: capabilities: Introduce QEMU_CAPS_MIGRATION_PARAM_BLOCK_BITMAP_MAPPING qemu: Probe whether an image is 'qcow2 v2' from query-named-block-nodes virDomainMigrateVersion3Full: Don't set 'cancelled' to the same value qemuMigrationSrcPerformPeer2Peer3: Don't leak 'dom_xml' on cleanup testutils: virTestRewrapFile: Rewrap also '.argv' files storagevolxml2argvdata: Rewrap all output files storage: Format qcow2v3 volumes by default qemu: monitor: Introduce qemuMonitorBitmapRemove qemu: blockjob: Use qemuMonitorBitmapRemove for single bitmap removal qemu: migration_params: Add infrastructure for 'dirty-bitmaps' migration feature qemu: migration_cookie: Add XML handling for setting up bitmap migration qemu: migration_cookie: Add helpers for transforming the cookie into migration params qemu: domain: Store list of temporary bitmaps for migration in status XML tests: qemustatusxml2xml: Add status XML from migration with bitmaps tests: qemumigrationcookie: Add testing for block dirty bitmap migration qemu: migration: Clean up temporary bitmaps when cancelling a migration qemu: migration: Migrate block dirty bitmaps corresponding to checkpoints qemu: capabilities: Enable QEMU_CAPS_INCREMENTAL_BACKUP src/libvirt-domain.c | 2 - src/qemu/qemu_blockjob.c | 24 +- src/qemu/qemu_capabilities.c | 8 +- src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_domain.c | 90 ++- src/qemu/qemu_domain.h | 15 + src/qemu/qemu_migration.c | 366 ++++++++++- src/qemu/qemu_migration_cookie.c | 249 ++++++++ src/qemu/qemu_migration_cookie.h | 41 ++ src/qemu/qemu_migration_params.c | 24 + src/qemu/qemu_migration_params.h | 5 + src/qemu/qemu_monitor.c | 13 + src/qemu/qemu_monitor.h | 8 + src/qemu/qemu_monitor_json.c | 35 ++ src/qemu/qemu_monitor_json.h | 6 + src/storage/storage_util.c | 2 +- tests/meson.build | 2 +- tests/qemublocktest.c | 2 + tests/qemublocktestdata/bitmap/synthetic.json | 2 +- tests/qemublocktestdata/bitmap/synthetic.out | 1 + .../caps_6.0.0.x86_64.replies | 510 +++++++++------- .../caps_6.0.0.x86_64.xml | 16 +- .../nbd-bitmaps-xml2xml-in.xml | 52 ++ .../nbd-bitmaps-xml2xml-migparams.json | 25 + .../nbd-bitmaps-xml2xml-out.xml | 51 ++ tests/qemumigrationcookiexmltest.c | 166 ++++- tests/qemumonitorjsontest.c | 2 + .../migration-out-nbd-bitmaps-in.xml | 574 ++++++++++++++++++ .../migration-out-nbd-bitmaps-out.xml | 1 + tests/qemustatusxml2xmltest.c | 1 + tests/storagevolxml2argvdata/iso-input.argv | 6 +- tests/storagevolxml2argvdata/iso.argv | 4 +- .../logical-from-qcow2.argv | 6 +- tests/storagevolxml2argvdata/luks-cipher.argv | 8 +- .../luks-convert-encrypt.argv | 23 +- .../luks-convert-encrypt2fileqcow2.argv | 21 +- .../luks-convert-encrypt2fileraw.argv | 20 +- .../luks-convert-qcow2.argv | 21 +- .../storagevolxml2argvdata/luks-convert.argv | 20 +- tests/storagevolxml2argvdata/luks.argv | 8 +- tests/storagevolxml2argvdata/qcow2-1.1.argv | 8 +- .../storagevolxml2argvdata/qcow2-compat.argv | 8 +- .../qcow2-from-logical-compat.argv | 8 +- tests/storagevolxml2argvdata/qcow2-lazy.argv | 9 +- .../qcow2-luks-convert-encrypt.argv | 2 +- .../qcow2-luks-convert-encrypt2fileqcow2.argv | 2 +- tests/storagevolxml2argvdata/qcow2-luks.argv | 2 +- ...ow2-nobacking-convert-prealloc-compat.argv | 10 +- .../qcow2-nobacking-prealloc-compat.argv | 8 +- .../qcow2-nocapacity-convert-prealloc.argv | 9 +- .../qcow2-nocapacity.argv | 6 +- .../qcow2-nocow-compat.argv | 9 +- tests/storagevolxml2argvdata/qcow2-nocow.argv | 9 +- .../qcow2-zerocapacity.argv | 5 +- tests/testutils.c | 1 + 55 files changed, 2170 insertions(+), 357 deletions(-) create mode 100644 tests/qemumigrationcookiexmldata/nbd-bitmaps-xml2xml-in.xml create mode 100644 tests/qemumigrationcookiexmldata/nbd-bitmaps-xml2xml-migparams.json create mode 100644 tests/qemumigrationcookiexmldata/nbd-bitmaps-xml2xml-out.xml create mode 100644 tests/qemustatusxml2xmldata/migration-out-nbd-bitmaps-in.xml create mode 120000 tests/qemustatusxml2xmldata/migration-out-nbd-bitmaps-out.xml -- 2.29.2