fix #1417: check if storage has 'images' set in content

otherwise, qm and the api ignore this setting completely when creating
a vm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-06-19 13:54:49 +02:00 committed by Wolfgang Bumiller
parent 5f54c8d443
commit c46366fd49

View File

@ -70,6 +70,9 @@ my $check_storage_access = sub {
my ($storeid, $size) = ($2 || $default_storage, $3); my ($storeid, $size) = ($2 || $default_storage, $3);
die "no storage ID specified (and no default storage)\n" if !$storeid; die "no storage ID specified (and no default storage)\n" if !$storeid;
$rpcenv->check($authuser, "/storage/$storeid", ['Datastore.AllocateSpace']); $rpcenv->check($authuser, "/storage/$storeid", ['Datastore.AllocateSpace']);
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
raise_param_exc({ storage => "storage '$storeid' does not support vm images"})
if !$scfg->{content}->{images};
} else { } else {
PVE::Storage::check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid); PVE::Storage::check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid);
} }