]> git.proxmox.com Git - qemu-server.git/commitdiff
refactor storage whitelist in sync_disks to regex
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 Dec 2019 17:40:03 +0000 (18:40 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 Dec 2019 17:40:03 +0000 (18:40 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuMigrate.pm

index 22cc89467dc87204409a7bad99b880ef8d3a37a9..b5df035edaa060ac8117f5b20730eb98f5f92c1c 100644 (file)
@@ -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;