migrate prepare: make content type check generic

to avoid false-positives, e.g., from a ISO on a ISO only storage.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-23 12:15:42 +02:00
parent 8a5bd88907
commit db861a4617

View File

@ -345,9 +345,10 @@ sub prepare {
$targetsid,
$self->{node},
);
my ($vtype) = PVE::Storage::parse_volname($storecfg, $volid);
die "content type 'images' is not available on storage '$targetsid'\n"
if !$target_scfg->{content}->{images};
die "$volid: content type '$vtype' is not available on storage '$targetsid'\n"
if !$target_scfg->{content}->{$vtype};
if ($scfg->{shared}) {
# PVE::Storage::activate_storage checks this for non-shared storages