migrate: simplify code and add comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-09-22 09:25:53 +02:00
parent d213ba299d
commit 95b3583b5e

View File

@ -339,10 +339,9 @@ sub prepare {
# check if storage is available on both nodes # check if storage is available on both nodes
my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid); my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid);
my $targetsid; my $targetsid = $sid;
if ($scfg->{shared}) { # NOTE: we currently ignore shared source storages in mappings so skip here too for now
$targetsid = $sid; if (!$scfg->{shared}) {
} else {
$targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $sid); $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 # check if storage is available on both nodes
my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid); my $scfg = PVE::Storage::storage_check_enabled($storecfg, $sid);
my $targetsid; my $targetsid = $sid;
if ($scfg->{shared}) { # NOTE: we currently ignore shared source storages in mappings so skip here too for now
$targetsid = $sid; if (!$scfg->{shared}) {
} else {
$targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $sid); $targetsid = PVE::QemuServer::map_storage($self->{opts}->{storagemap}, $sid);
} }