die "unknown snapshot path for '$volid'" if !$storage && defined($snapname);
- my $optstring = '';
+ my @mountoptions= split(/;/, $mountpoint->{mountoptions});
+ my $optlist = [];
+ my $allowed_options = PVE::LXC::Config::get_mount_options();
+ foreach my $opt (@mountoptions) {
+ push @$optlist, $opt if $opt =~ $allowed_options
+ }
+
my $acl = $mountpoint->{acl};
if (defined($acl)) {
- $optstring .= ($acl ? 'acl' : 'noacl');
+ push @$optlist, ($acl ? 'acl' : 'noacl');
}
+
+ my $optstring = join(',', @$optlist);
my $readonly = $mountpoint->{ro};
my @extra_opts;
cfs_register_file('/lxc/', \&parse_pct_config, \&write_pct_config);
+my $mount_option = qr/(noatime|nodev|nosuid|noexec)/;
+
+sub get_mount_options {
+ return $mount_option;
+}
+
my $rootfs_desc = {
volume => {
type => 'string',
description => 'Explicitly enable or disable ACL support.',
optional => 1,
},
+ mountoptions => {
+ optional => 1,
+ type => 'string',
+ description => 'Extra mount options for rootfs/mps.',
+ format_description => 'opt[;opt...]',
+ pattern => qr/$mount_option(;$mount_option)*/,
+ },
ro => {
type => 'boolean',
description => 'Read-only mount point',