mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-01-03 01:18:01 +03:00
fix #2920: cifs: add options parameter
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>
This commit is contained in:
parent
765e0da23f
commit
13ee4fc859
@ -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 },
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user