]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer.pm
migration: add missing use statements
[qemu-server.git] / PVE / QemuServer.pm
index 24aaa9424163063e9e35d8c5c34e0faee2c1e8eb..5df0c96d5341a42e84f6827432895a0eded37792 100644 (file)
@@ -421,7 +421,7 @@ wvista;; Microsoft Windows Vista
 win7;; Microsoft Windows 7
 win8;; Microsoft Windows 8/2012/2012r2
 win10;; Microsoft Windows 10/2016/2019
-win11;; Microsoft Windows 11/2022
+win11;; Microsoft Windows 11/2022/2025
 l24;; Linux 2.4 Kernel
 l26;; Linux 2.6 - 6.X Kernel
 solaris;; Solaris/OpenSolaris/OpenIndiania kernel
@@ -590,7 +590,10 @@ EODESCR
     migrate_downtime => {
        optional => 1,
        type => 'number',
-       description => "Set maximum tolerated downtime (in seconds) for migrations.",
+       description => "Set maximum tolerated downtime (in seconds) for migrations. Should the"
+           ." migration not be able to converge in the very end, because too much newly dirtied"
+           ." RAM needs to be transferred, the limit will be increased automatically step-by-step"
+           ." until migration can converge.",
        minimum => 0,
        default => 0.1,
     },
@@ -6403,7 +6406,8 @@ sub vm_suspend {
            if ($err) {
                # cleanup, but leave suspending lock, to indicate something went wrong
                eval {
-                   mon_cmd($vmid, "savevm-end");
+                   eval { mon_cmd($vmid, "savevm-end"); };
+                   warn $@ if $@;
                    PVE::Storage::deactivate_volumes($storecfg, [$vmstate]);
                    PVE::Storage::vdisk_free($storecfg, $vmstate);
                    delete $conf->@{qw(vmstate runningmachine runningcpu)};
@@ -8154,7 +8158,8 @@ sub clone_disk {
     my ($newvmid, $dst_drivename, $efisize) = $dest->@{qw(vmid drivename efisize)};
     my ($storage, $format) = $dest->@{qw(storage format)};
 
-    my $use_drive_mirror = $full && $running && $src_drivename && !$snapname;
+    my $unused = defined($src_drivename) && $src_drivename =~ /^unused/;
+    my $use_drive_mirror = $full && $running && $src_drivename && !$snapname && !$unused;
 
     if ($src_drivename && $dst_drivename && $src_drivename ne $dst_drivename) {
        die "cloning from/to EFI disk requires EFI disk\n"
@@ -8260,7 +8265,7 @@ no_data_clone:
     my $disk = dclone($drive);
     delete $disk->{format};
     $disk->{file} = $newvolid;
-    $disk->{size} = $size if defined($size);
+    $disk->{size} = $size if defined($size) && !$unused;
 
     return $disk;
 }