block/mirror: Add active mirroring
commitd06107ade0ce74dc39739bac80de84b51ec18546
authorMax Reitz <mreitz@redhat.com>
Wed, 13 Jun 2018 18:18:21 +0000 (13 20:18 +0200)
committerMax Reitz <mreitz@redhat.com>
Mon, 18 Jun 2018 15:05:15 +0000 (18 17:05 +0200)
treedb91864d1ef290e181e2787f6cea856b0e15766d
parent62f13600593322b8e796f15fd6742064fba6ab65
block/mirror: Add active mirroring

This patch implements active synchronous mirroring.  In active mode, the
passive mechanism will still be in place and is used to copy all
initially dirty clusters off the source disk; but every write request
will write data both to the source and the target disk, so the source
cannot be dirtied faster than data is mirrored to the target.  Also,
once the block job has converged (BLOCK_JOB_READY sent), source and
target are guaranteed to stay in sync (unless an error occurs).

Active mode is completely optional and currently disabled at runtime.  A
later patch will add a way for users to enable it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 20180613181823.13618-13-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/mirror.c
qapi/block-core.json