[pve-devel] [PATCH] Add transport option for glusterfs storage

Stoyan Marinov stoyan at marinov.us
Thu Oct 16 18:14:18 CEST 2014


Signed-off-by: Stoyan Marinov <stoyan at marinov.us>
---
 PVE/Storage/GlusterfsPlugin.pm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage/GlusterfsPlugin.pm b/PVE/Storage/GlusterfsPlugin.pm
index ee70603..36322b1 100644
--- a/PVE/Storage/GlusterfsPlugin.pm
+++ b/PVE/Storage/GlusterfsPlugin.pm
@@ -126,6 +126,11 @@ sub properties {
 	    type => 'string', format => 'pve-storage-server',
 	    requires => 'server',
 	},
+	transport => {
+	    description => "Gluster transport: tcp or rdma",
+	    type => 'string',
+	    enum => ['tcp', 'rdma', 'unix'],
+    	},
     };
 }
 
@@ -135,6 +140,7 @@ sub options {
 	server => { optional => 1 },
 	server2 => { optional => 1 },
 	volume => { fixed => 1 },
+	transport => { optional => 1 },
         nodes => { optional => 1 },
 	disable => { optional => 1 },
         maxfiles => { optional => 1 },
@@ -194,8 +200,14 @@ sub path {
 
 	my $server = &$get_active_server($scfg, 1);
 	my $glustervolume = $scfg->{volume};
+	my $transport = $scfg->{transport};
+	my $protocol = "gluster";
+
+	if ($transport) {
+	    $protocol = "gluster+$transport";
+	}
 
-	$path = "gluster://$server/$glustervolume/images/$vmid/$name";
+	$path = "$protocol://$server/$glustervolume/images/$vmid/$name";
 
     } else {
 	my $dir = $class->get_subdir($scfg, $vtype);
-- 
1.7.12.4 (Apple Git-37)




More information about the pve-devel mailing list