[pve-devel] [PATCH qemu-server 2/5] don't repeat storage check for each volid

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Jun 17 16:12:26 CEST 2016


---
 PVE/QemuMigrate.pm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 3e90a46..e42e5b1 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
             });
         }
 
-- 
2.1.4




More information about the pve-devel mailing list