[pve-devel] [PATCH qemu-server] migrate: skip rescan for efidisk and shared volumes

Dominik Csapak d.csapak at proxmox.com
Thu Apr 30 12:44:48 CEST 2020


we really only want to rescan the disk size of the disks we actually
need, and that are only the local disks (for which we have to allocate
the correct size on the target)

also we want to always skip the efidisk, since we get the wanted
size after the loop, and this produced a confusing log line
(for details why we do not want the 'real' size,
see commit 818ce80ec1a89c4abee61145c858b9323180e31b)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/QemuMigrate.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 7644922..f116add 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -518,6 +518,9 @@ sub sync_disks {
 	my $volid_hash = PVE::QemuServer::scan_volids($storecfg, $vmid);
 	PVE::QemuConfig->foreach_volume($conf, sub {
 	    my ($key, $drive) = @_;
+	    return if $key eq 'efidisk0'; # skip efidisk, will be handled later
+	    return if !defined($local_volumes->{$key}); # only update sizes for local volumes
+
 	    my ($updated, $old_size, $new_size) = PVE::QemuServer::Drive::update_disksize($drive, $volid_hash);
 	    if (defined($updated)) {
 		$conf->{$key} = PVE::QemuServer::print_drive($updated);
-- 
2.20.1





More information about the pve-devel mailing list