From 89719f988705b3f5f0d1b2af8e068d92a9a5196d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 17 Jun 2016 16:12:26 +0200 Subject: [PATCH] don't repeat storage check for each volid --- PVE/QemuMigrate.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 3e90a467..e42e5b17 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -237,14 +237,17 @@ sub sync_disks { # get list from PVE::Storage (for unused volumes) my $dl = PVE::Storage::vdisk_list($self->{storecfg}, $storeid, $vmid); + + next if @{$dl->{$storeid}} == 0; + + # check if storage is available on target node + PVE::Storage::storage_check_node($self->{storecfg}, $storeid, $self->{node}); + $sharedvm = 0; # there is a non-shared disk + PVE::Storage::foreach_volid($dl, sub { my ($volid, $sid, $volname) = @_; - # check if storage is available on target node - PVE::Storage::storage_check_node($self->{storecfg}, $sid, $self->{node}); - $volhash->{$volid} = 1; - $sharedvm = 0; # there is a non-shared disk }); }