From 95b3583b5ebb22ad94c4348a2afa3e199e044ec7 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 22 Sep 2021 09:25:53 +0200 Subject: [PATCH] migrate: simplify code and add comment Signed-off-by: Thomas Lamprecht --- PVE/QemuMigrate.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index b7812ddc..62bf5bc6 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -339,10 +339,9 @@ sub prepare { # check if storage is available on both nodes my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid); - my $targetsid; - if ($scfg->{shared}) { - $targetsid = $sid; - } else { + my $targetsid = $sid; + # NOTE: we currently ignore shared source storages in mappings so skip here too for now + if (!$scfg->{shared}) { $targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $sid); } @@ -481,10 +480,9 @@ sub scan_local_volumes { # check if storage is available on both nodes my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid); - my $targetsid; - if ($scfg->{shared}) { - $targetsid = $sid; - } else { + my $targetsid = $sid; + # NOTE: we currently ignore shared source storages in mappings so skip here too for now + if (!$scfg->{shared}) { $targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $sid); }