config: add vmstatestorage option

and permission checks

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2017-05-15 14:11:56 +02:00 committed by Wolfgang Bumiller
parent c268337d93
commit 253624c76f
2 changed files with 11 additions and 0 deletions

View File

@ -78,6 +78,9 @@ my $check_storage_access = sub {
PVE::Storage::check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid);
}
});
$rpcenv->check($authuser, "/storage/$settings->{vmstatestorage}", ['Datastore.AllocateSpace'])
if defined($settings->{vmstatestorage});
};
my $check_storage_access_clone = sub {
@ -114,6 +117,9 @@ my $check_storage_access_clone = sub {
}
});
$rpcenv->check($authuser, "/storage/$conf->{vmstatestorage}", ['Datastore.AllocateSpace'])
if defined($conf->{vmstatestorage});
return $sharedvm;
};
@ -257,6 +263,7 @@ my $vmpoweroptions = {
my $diskoptions = {
'boot' => 1,
'bootdisk' => 1,
'vmstatestorage' => 1,
};
my $check_vm_modify_config_perm = sub {

View File

@ -477,6 +477,10 @@ EODESCR
type => 'string', format => 'pve-volume-id',
description => "Reference to a volume which stores the VM state. This is used internally for snapshots.",
},
vmstatestorage => get_standard_option('pve-storage-id', {
description => "Default storage for VM state volumes/files.",
optional => 1,
}),
machine => {
description => "Specific the Qemu machine type.",
type => 'string',