]> git.proxmox.com Git - pve-storage.git/commitdiff
fix #2920: cifs: add options parameter
authorStefan Hrdlicka <s.hrdlicka@proxmox.com>
Wed, 1 Mar 2023 12:13:25 +0000 (13:13 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 7 Jun 2023 08:45:12 +0000 (10:45 +0200)
This makes it possible to add all mount options offered by mount.cifs.
NFS & CIFS now share the options parameter since they use it for the
same purpose.

Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
 [FE: rebase + style fixes]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
 [T: fix merge conflict ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Storage/CIFSPlugin.pm
src/PVE/Storage/NFSPlugin.pm
src/PVE/Storage/Plugin.pm

index e40641a22b838db876ccbd4d601de403bc7133d4..71b85aa99ae65c636746bbc417c3cc2cb4715685 100644 (file)
@@ -69,7 +69,7 @@ sub get_cred_file {
 sub cifs_mount : prototype($$$$$) {
     my ($scfg, $storeid, $smbver, $user, $domain) = @_;
 
-    my ($mountpoint, $server, $share) = $scfg->@{'path', 'server', 'share'};
+    my ($mountpoint, $server, $share, $options) = $scfg->@{'path', 'server', 'share', 'options'};
     my $subdir = $scfg->{subdir} // '';
 
     $server = "[$server]" if Net::IP::ip_is_ipv6($server);
@@ -85,6 +85,7 @@ sub cifs_mount : prototype($$$$$) {
     }
 
     push @$cmd, '-o', defined($smbver) ? "vers=$smbver" : "vers=default";
+    push @$cmd, '-o', $options if $options;
 
     run_command($cmd, errmsg => "mount error");
 }
@@ -154,6 +155,7 @@ sub options {
        'create-subdirs' => { optional => 1 },
        bwlimit => { optional => 1 },
        preallocation => { optional => 1 },
+       options => { optional => 1 },
     };
 }
 
index 6e92bddf5e7cad188fee4c821e9ed0e882195187..f2e4c0dc804986fcef938b3c47a6443ad0920bb5 100644 (file)
@@ -69,10 +69,6 @@ sub properties {
            description => "Server IP or DNS name.",
            type => 'string', format => 'pve-storage-server',
        },
-       options => {
-           description => "NFS mount options (see 'man nfs')",
-           type => 'string',  format => 'pve-storage-options',
-       },
     };
 }
 
index f6295edf1f951b567bfbcb2efff04db22a1cfa34..727b7a6b58f79c5c5fab9d93062858af93e12c82 100644 (file)
@@ -192,6 +192,12 @@ my $defaultData = {
            type => "string", format => "pve-dir-override-list",
            optional => 1,
        },
+       options => {
+           description => "NFS/CIFS mount options (see 'man nfs' or 'man mount.cifs')",
+           type => 'string',
+           format => 'pve-storage-options',
+           optional => 1,
+       },
     },
 };