[pve-devel] [PATCH 1/8] add mpX mountpoint config

Alexandre Derumier aderumier at odiso.com
Fri Aug 14 14:56:42 CEST 2015


10 mountpoint max currently (should be enough I think)

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/LXC.pm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 2cf8445..e43e723 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -233,6 +233,17 @@ for (my $i = 0; $i < $MAX_LXC_NETWORKS; $i++) {
     };
 }
 
+my $MAX_MOUNT_POINTS = 10;
+for (my $i = 0; $i < $MAX_MOUNT_POINTS; $i++) {
+    $confdesc->{"mp$i"} = {
+	optional => 1,
+	type => 'string', format => 'pve-ct-mountpoint',
+	typetext => '[volume=]volume,] [,backup=yes|no] [,size=\d+] [,mp=mountpoint]',
+	description => "Use volume as container mount point.",
+	optional => 1,
+    };
+}
+
 sub write_pct_config {
     my ($filename, $conf) = @_;
 
@@ -726,7 +737,7 @@ sub parse_ct_mountpoint {
     foreach my $p (split (/,/, $data)) {
 	next if $p =~ m/^\s*$/;
 
-	if ($p =~ m/^(volume|backup|size)=(.+)$/) {
+	if ($p =~ m/^(volume|backup|size|mp)=(.+)$/) {
 	    my ($k, $v) = ($1, $2);
 	    return undef if defined($res->{$k});
 	    $res->{$k} = $v;
-- 
2.1.4




More information about the pve-devel mailing list