From e3b121002175e7b543b3e717631b8bb183bf52ce Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 11 Apr 2023 16:42:18 +0200 Subject: [PATCH] migration: avoid variable declared in conditional statement Signed-off-by: Thomas Lamprecht --- src/PVE/LXC/Migrate.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm index 35455e1..ccf5157 100644 --- a/src/PVE/LXC/Migrate.pm +++ b/src/PVE/LXC/Migrate.pm @@ -55,9 +55,7 @@ sub prepare { PVE::LXC::Config->foreach_volume_full($conf, { include_unused => 1 }, sub { my ($ms, $mountpoint) = @_; - my $volid = $mountpoint->{volume}; my $type = $mountpoint->{type}; - # skip dev/bind mps when shared if ($type ne 'volume') { if ($mountpoint->{shared}) { @@ -67,7 +65,9 @@ sub prepare { } } - my ($storage, $volname) = PVE::Storage::parse_volume_id($volid, 1) if $volid; + my $volid = $mountpoint->{volume} or die "missing volume for mount point '$ms'\n"; + + my ($storage, $volname) = PVE::Storage::parse_volume_id($volid, 1); die "can't determine assigned storage for mount point '$ms'\n" if !$storage; # check if storage is available on both nodes -- 2.39.2