]> git.proxmox.com Git - qemu-server.git/commitdiff
qemu-server : drive-mirror : allow to interrupts at the scanning bitmap phase
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 1 Jul 2015 04:01:42 +0000 (06:01 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 1 Jul 2015 04:39:50 +0000 (06:39 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index ab9ac7491e6c3510d08d331ccc1d52e20f82f032..17c67ab57d12a578feb2097f8f1ef2e8a8b39291 100644 (file)
@@ -6054,17 +6054,13 @@ sub qemu_drive_mirror {
 
     my $dst_path = PVE::Storage::path($storecfg, $dst_volid);
 
-    #drive-mirror is doing lseek on source image before starting, and this can take a lot of time for big nfs volume
-    #during this time, qmp socket is hanging
-    #http://lists.nongnu.org/archive/html/qemu-devel/2015-05/msg01838.html
-    #so we need to setup a big timeout
-    my $opts = { timeout => 14400, device => "drive-$drive", mode => "existing", sync => "full", target => $dst_path };
+    my $opts = { timeout => 10, device => "drive-$drive", mode => "existing", sync => "full", target => $dst_path };
     $opts->{format} = $format if $format;
 
-    print "drive mirror is starting : this step can take some minutes/hours, depend of disk size and storage speed\n";
+    print "drive mirror is starting (scanning bitmap) : this step can take some minutes/hours, depend of disk size and storage speed\n";
 
-    vm_mon_cmd($vmid, "drive-mirror", %$opts);
     eval {
+    vm_mon_cmd($vmid, "drive-mirror", %$opts);
        while (1) {
            my $stats = vm_mon_cmd($vmid, "query-block-jobs");
            my $stat = @$stats[0];