From dad06e20686da658b9f905ee4103de073b2edfb7 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 4 Dec 2019 18:40:03 +0100 Subject: [PATCH] refactor storage whitelist in sync_disks to regex Signed-off-by: Thomas Lamprecht --- PVE/QemuMigrate.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 22cc8946..b5df035e 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -426,8 +426,7 @@ sub sync_disks { my ($sid, $volname) = PVE::Storage::parse_volume_id($volid); my $scfg = PVE::Storage::storage_config($self->{storecfg}, $sid); - my $migratable = ($scfg->{type} eq 'dir') || ($scfg->{type} eq 'zfspool') || - ($scfg->{type} eq 'lvmthin') || ($scfg->{type} eq 'lvm'); + my $migratable = $scfg->{type} =~ /^(?:dir|zfspool|lvmthin|lvm)$/; die "can't migrate '$volid' - storage type '$scfg->{type}' not supported\n" if !$migratable;