[pve-devel] [PATCH 5/7] Only append volumes which is created by pve-manager

Alexandre DERUMIER aderumier at odiso.com
Mon Jun 24 08:50:28 CEST 2013


Maybe this can be done using the regex instead split ?


----- Mail original ----- 

De: mir at datanom.net 
À: devel at lists.claws-mail.org, pve-devel at pve.proxmox.com 
Envoyé: Dimanche 23 Juin 2013 22:34:00 
Objet: [pve-devel] [PATCH 5/7] Only append volumes which is created by pve-manager 

From: Michael Rasmussen <mir at datanom.net> 

Signed-off-by: Michael Rasmussen <mir at datanom.net> 
--- 
PVE/Storage/ZFSPlugin.pm | 5 ++++- 
1 file changed, 4 insertions(+), 1 deletion(-) 

diff --git a/PVE/Storage/ZFSPlugin.pm b/PVE/Storage/ZFSPlugin.pm 
index e39b965..ff32b97 100644 
--- a/PVE/Storage/ZFSPlugin.pm 
+++ b/PVE/Storage/ZFSPlugin.pm 
@@ -141,8 +141,11 @@ sub zfs_parse_zvol_list { 
my @lines = split /\n/, $text; 
foreach my $line (@lines) { 
@zvols = split /\//, $line; 
+ my $pool = $zvols[0]; 
if (scalar(@zvols) == 2 && $zvols[0] !~ /^rpool$/) { 
- push (@list, $zvols[0] . '/' . $zvols[1]); 
+ my $disk = $zvols[1]; 
+ next unless $disk =~ m!^(\w+)-(\d+)-(\w+)-(\d+)$!; 
+ push (@list, $pool . '/' . $disk); 
} 
} 

-- 
1.8.3.1 

_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 



More information about the pve-devel mailing list