]> git.proxmox.com Git - qemu-server.git/commitdiff
qmp drive-mirror : set big timeout
authorAlexandre Derumier <aderumier@odiso.com>
Mon, 11 May 2015 13:55:22 +0000 (15:55 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 12 May 2015 06:18:42 +0000 (08:18 +0200)
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

qemu devs are currently working to fix this

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index 5fca5bf2a610c16b33fc74612c6e5a418c843bcd..08be8ba17583604ab41134de17b8c9396dad6d09 100644 (file)
@@ -6092,14 +6092,16 @@ sub qemu_drive_mirror {
 
     my $dst_path = PVE::Storage::path($storecfg, $dst_volid);
 
-    my $opts = { timeout => 10, device => "drive-$drive", mode => "existing", sync => "full", target => $dst_path };
+    #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 };
     $opts->{format} = $format if $format;
 
-    #fixme : sometime drive-mirror timeout, but works fine after.
-    # (I have see the problem with big volume > 200GB), so we need to eval
-    eval { vm_mon_cmd($vmid, "drive-mirror", %$opts); };
-    # ignore errors here
+    print "drive mirror is starting : this step can take some minutes/hours, depend of disk size and storage speed\n";
 
+    vm_mon_cmd($vmid, "drive-mirror", %$opts);
     eval {
        while (1) {
            my $stats = vm_mon_cmd($vmid, "query-block-jobs");