]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer.pm
fix: #1075: Restore VM template to VM and try to convert to template.
[qemu-server.git] / PVE / QemuServer.pm
index ba14579977e6fbb76a8dcac2e331fbba8786bf5b..2ca5f6e9008a44fdfef82c390f5458e606da91aa 100644 (file)
@@ -5904,7 +5904,6 @@ sub restore_update_config_line {
     return if $line =~ m/^lock:/;
     return if $line =~ m/^unused\d+:/;
     return if $line =~ m/^parent:/;
-    return if $line =~ m/^template:/; # restored VM is never a template
 
     my $dc = PVE::Cluster::cfs_read_file('datacenter.cfg');
     if (($line =~ m/^(vlan(\d+)):\s*(\S+)\s*$/)) {
@@ -6756,8 +6755,8 @@ sub qemu_drive_mirror {
     $opts->{format} = $format if $format;
 
     if (defined($bwlimit)) {
-       my $bwlimit_bps = $opts->{speed} = $bwlimit * 1024;
-       print "drive mirror is starting for drive-$drive with bandwidth limit: ${bwlimit}KB/s\n";
+       $opts->{speed} = $bwlimit * 1024;
+       print "drive mirror is starting for drive-$drive with bandwidth limit: ${bwlimit} KB/s\n";
     } else {
        print "drive mirror is starting for drive-$drive\n";
     }
@@ -6905,7 +6904,7 @@ sub qemu_blockjobs_cancel {
 
 sub clone_disk {
     my ($storecfg, $vmid, $running, $drivename, $drive, $snapname,
-       $newvmid, $storage, $format, $full, $newvollist, $jobs, $skipcomplete, $qga) = @_;
+       $newvmid, $storage, $format, $full, $newvollist, $jobs, $skipcomplete, $qga, $bwlimit) = @_;
 
     my $newvolid;
 
@@ -6950,7 +6949,7 @@ sub clone_disk {
                    if $drive->{iothread};
            }
 
-           qemu_drive_mirror($vmid, $drivename, $newvolid, $newvmid, $sparseinit, $jobs, $skipcomplete, $qga);
+           qemu_drive_mirror($vmid, $drivename, $newvolid, $newvmid, $sparseinit, $jobs, $skipcomplete, $qga, $bwlimit);
        }
     }