On 06/14/2016 09:25 AM, Denis V. Lunev wrote:
Block commit of the active image to the backing store on a slow disk
could never end. For example with the guest with the following loop
while true; do
dd bs=1k count=1 if=/dev/zero of=x
running above slow storage could not complete the operation with a
resonable amount of time:
virsh blockcommit rhel7 sda --active --shallow
virsh qemu-monitor-command rhel7 \
Completion event is never received.
This problem could not be fixed easily with the current architecture. We
should either prohibit guest writes (making dirty bitmap dirty) or switch
to the sycnchronous scheme.
This patch implements the latter. It adds mirror_before_write_notify
callback. In this case all data written from the guest is synchnonously
written to the mirror target. Though the problem is solved partially.
We should switch from bdrv_dirty_bitmap to simple hbitmap. This will be
done in the next patch.
In other words, the mere act of mirroring a guest will now be
guest-visible in that the guest is auto-throttled while waiting for the
mirroring to be written out. It seems like you would want to be able to
opt in or out of this scheme. Is it something that can be toggled
mid-operation (try asynchronous, and switch to synchronous if a timeout
Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy<address@hidden>
CC: Stefan Hajnoczi <address@hidden>
CC: Fam Zheng <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Max Reitz <address@hidden>
CC: Jeff Cody <address@hidden>
CC: Eric Blake <address@hidden>
block/mirror.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
I'll leave the actual idea to others to review, because there may be
some ramifications that I'm not thinking of.