5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-08 04:58:26 +03:00

drive-mirror: add support for incremental sync

by re-using a dirty bitmap that represents changes since the divergence
of source and target volume. requires a qemu that supports incremental
drive-mirroring, and will die otherwise.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2020-03-17 08:55:25 +01:00 committed by Thomas Lamprecht
parent 43c4c7b693
commit bc6c823164

View File

@ -6529,7 +6529,7 @@ sub qemu_img_format {
}
sub qemu_drive_mirror {
my ($vmid, $drive, $dst_volid, $vmiddst, $is_zero_initialized, $jobs, $completion, $qga, $bwlimit) = @_;
my ($vmid, $drive, $dst_volid, $vmiddst, $is_zero_initialized, $jobs, $completion, $qga, $bwlimit, $src_bitmap) = @_;
$jobs = {} if !$jobs;
@ -6556,6 +6556,12 @@ sub qemu_drive_mirror {
my $opts = { timeout => 10, device => "drive-$drive", mode => "existing", sync => "full", target => $qemu_target };
$opts->{format} = $format if $format;
if (defined($src_bitmap)) {
$opts->{sync} = 'incremental';
$opts->{bitmap} = $src_bitmap;
print "drive mirror re-using dirty bitmap '$src_bitmap'\n";
}
if (defined($bwlimit)) {
$opts->{speed} = $bwlimit * 1024;
print "drive mirror is starting for drive-$drive with bandwidth limit: ${bwlimit} KB/s\n";