mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-01 08:05:24 +00:00
api: create/modify: fix content type checks by re-allowing iso images
Fixes: f9be9137
("api: create/modify: add content type checks"
Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
6f070e39de
commit
db81c00754
@ -142,14 +142,12 @@ my $check_storage_access = sub {
|
|||||||
raise_param_exc({ storage => "storage '$storeid' does not support vm images"})
|
raise_param_exc({ storage => "storage '$storeid' does not support vm images"})
|
||||||
if !$scfg->{content}->{images};
|
if !$scfg->{content}->{images};
|
||||||
} else {
|
} else {
|
||||||
PVE::Storage::check_volume_access(
|
PVE::Storage::check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid);
|
||||||
$rpcenv,
|
if ($storeid) {
|
||||||
$authuser,
|
my ($vtype) = PVE::Storage::parse_volname($storecfg, $volid);
|
||||||
$storecfg,
|
raise_param_exc({ $ds => "content type needs to be 'images' or 'iso'" })
|
||||||
$vmid,
|
if $vtype ne 'images' && $vtype ne 'iso';
|
||||||
$volid,
|
}
|
||||||
'images',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (my $src_image = $drive->{'import-from'}) {
|
if (my $src_image = $drive->{'import-from'}) {
|
||||||
@ -421,14 +419,12 @@ my $create_disks = sub {
|
|||||||
|
|
||||||
print "$ds: successfully created disk '$res->{$ds}'\n";
|
print "$ds: successfully created disk '$res->{$ds}'\n";
|
||||||
} else {
|
} else {
|
||||||
PVE::Storage::check_volume_access(
|
PVE::Storage::check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid);
|
||||||
$rpcenv,
|
if ($storeid) {
|
||||||
$authuser,
|
my ($vtype) = PVE::Storage::parse_volname($storecfg, $volid);
|
||||||
$storecfg,
|
die "cannot use volume $volid - content type needs to be 'images' or 'iso'"
|
||||||
$vmid,
|
if $vtype ne 'images' && $vtype ne 'iso';
|
||||||
$volid,
|
}
|
||||||
'images',
|
|
||||||
);
|
|
||||||
|
|
||||||
PVE::Storage::activate_volumes($storecfg, [ $volid ]) if $storeid;
|
PVE::Storage::activate_volumes($storecfg, [ $volid ]) if $storeid;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user