Here are my block mirroring patches for QEMU 1.4, please review. Patches 1-12 implement improvements and optimizations to the code that went in 1.3.
Patches 13-20 (lacking tests for now) implement a persistent dirty bitmap. The bitmap can be used to run storage migration jobs across multiple executions of the VM or, in the future, offline via qemu-img. Paolo Paolo Bonzini (20): host-utils: add ffsl add hierarchical bitmap data type and test cases block: implement dirty bitmap using HBitmap block: make round_to_clusters public mirror: perform COW if the cluster size is bigger than the granularity block: return count of dirty sectors, not chunks block: allow customizing the granularity of the dirty bitmap mirror: allow customizing the granularity mirror: switch mirror_iteration to AIO mirror: add buf-size argument to drive-mirror mirror: support more than one in-flight AIO operation mirror: support arbitrarily-sized iterations oslib: add a wrapper for mmap/munmap hbitmap: add hbitmap_alloc_with_data and hbitmap_required_size hbitmap: add hbitmap_copy block: split bdrv_enable_dirty_tracking and bdrv_disable_dirty_tracking block: support a persistent dirty bitmap mirror: add support for persistent dirty bitmap block: choose the default dirty bitmap granularity in bdrv_enable_dirty_tracking monitor: add commands to start/stop dirty bitmap Makefile.objs | 2 +- block-migration.c | 22 +- block.c | 279 +++++++++++++++++--------- block.h | 18 +- block/mirror.c | 393 ++++++++++++++++++++++++++++++------ block_int.h | 15 +- blockdev.c | 83 ++++++-- blockdev.h | 1 + hbitmap.c | 485 +++++++++++++++++++++++++++++++++++++++++++++ hbitmap.h | 243 +++++++++++++++++++++++ hmp-commands.hx | 39 ++++ hmp.c | 29 ++- hmp.h | 2 + host-utils.h | 26 +++ osdep.h | 10 + oslib-posix.c | 47 +++++ oslib-win32.c | 59 ++++++ qapi-schema.json | 71 ++++++- qmp-commands.hx | 75 ++++++- tests/Makefile | 2 + tests/qemu-iotests/041 | 52 +++++ tests/qemu-iotests/041.out | 4 +- tests/test-hbitmap.c | 475 ++++++++++++++++++++++++++++++++++++++++++++ trace-events | 12 ++ 24 files changed, 2247 insertions(+), 197 deletions(-) create mode 100644 hbitmap.c create mode 100644 hbitmap.h create mode 100644 tests/test-hbitmap.c -- 1.8.0.1