Maybe this can be done using the regex instead split ?
----- Mail original ----- De: [email protected] À: [email protected], [email protected] 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 <[email protected]> Signed-off-by: Michael Rasmussen <[email protected]> --- 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 [email protected] http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel _______________________________________________ pve-devel mailing list [email protected] http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
