]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #1417: check if storage has 'images' set in content
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 19 Jun 2017 11:54:49 +0000 (13:54 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 30 Jun 2017 07:26:53 +0000 (09:26 +0200)
otherwise, qm and the api ignore this setting completely when creating
a vm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Qemu.pm

index 40e68ddd702aeafb7a17363c95d5b1a1bc5468cb..efb3198f2d5c8e00bc24e999632ab4c946ec046d 100644 (file)
@@ -70,6 +70,9 @@ my $check_storage_access = sub {
            my ($storeid, $size) = ($2 || $default_storage, $3);
            die "no storage ID specified (and no default storage)\n" if !$storeid;
            $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 {
            PVE::Storage::check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid);
        }