]> git.proxmox.com Git - qemu-server.git/commitdiff
config: add vmstatestorage option
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 15 May 2017 12:11:56 +0000 (14:11 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 22 Sep 2017 08:02:54 +0000 (10:02 +0200)
and permission checks

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/API2/Qemu.pm
PVE/QemuServer.pm

index 869eb8c109aeb87883e43b0cbc2483b5adf53a2a..2c32648697fb5953d3ad46c85adb6a4bbbfdd5d7 100644 (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 {
index 03e7ca415f2181a64e0206711f70e8519f1e40c3..e3169b67e2cc9b8593e9bc2a500378e1d5677c3e 100644 (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',