[pve-devel] r5292 - pve-storage/trunk

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Oct 28 12:39:20 CEST 2010


Author: dietmar
Date: 2010-10-28 10:39:20 +0000 (Thu, 28 Oct 2010)
New Revision: 5292

Modified:
   pve-storage/trunk/ChangeLog
   pve-storage/trunk/Makefile
   pve-storage/trunk/Storage.pm
   pve-storage/trunk/changelog.Debian
Log:


Modified: pve-storage/trunk/ChangeLog
===================================================================
--- pve-storage/trunk/ChangeLog	2010-10-28 10:15:15 UTC (rev 5291)
+++ pve-storage/trunk/ChangeLog	2010-10-28 10:39:20 UTC (rev 5292)
@@ -1,3 +1,9 @@
+2010-10-28  Proxmox Support Team  <support at proxmox.com>
+
+	* Storage.pm (iscsi_session_list): allow several sessions per
+	target (multipath).
+	(iscsi_session_rescan): rescan all sessions
+
 2010-09-13  Proxmox Support Team  <support at proxmox.com>
 
 	* Storage.pm (storage_info): cache VGs, mountdata and iSCSI session list.

Modified: pve-storage/trunk/Makefile
===================================================================
--- pve-storage/trunk/Makefile	2010-10-28 10:15:15 UTC (rev 5291)
+++ pve-storage/trunk/Makefile	2010-10-28 10:39:20 UTC (rev 5292)
@@ -2,7 +2,7 @@
 
 VERSION=1.0
 PACKAGE=libpve-storage-perl
-PKGREL=14
+PKGREL=15
 
 DESTDIR=
 PREFIX=/usr

Modified: pve-storage/trunk/Storage.pm
===================================================================
--- pve-storage/trunk/Storage.pm	2010-10-28 10:15:15 UTC (rev 5291)
+++ pve-storage/trunk/Storage.pm	2010-10-28 10:39:20 UTC (rev 5292)
@@ -1096,7 +1096,8 @@
 
 	if ($line =~ m/^tcp:\s+\[(\S+)\]\s+\S+\s+(\S+)\s*$/) {
 	    my ($session, $target) = ($1, $2);
-	    $res->{$target} = $session;
+	    # there can be several sessions per target (multipath)
+	    push @{$res->{$target}}, $session;
 	}
     });
 
@@ -1150,7 +1151,7 @@
 my $rescan_filename = "/var/run/pve-iscsi-rescan.lock";
 
 sub iscsi_session_rescan {
-    my $session = shift;
+    my $session_list = shift;
 
     check_iscsi_support ();
 
@@ -1169,9 +1170,11 @@
 	utime undef, undef, $rescan_filename;
     }
 
-    my $cmd = [$ISCSIADM, '--mode', 'session', '-r', $session, '-R'];
-    eval { run_command ($cmd, outfunc => sub {}); };
-    warn $@ if $@;
+    foreach my $session (@$session_list) {
+	my $cmd = [$ISCSIADM, '--mode', 'session', '-r', $session, '-R'];
+	eval { run_command ($cmd, outfunc => sub {}); };
+	warn $@ if $@;
+    }
 }
 
 sub iscsi_device_list {
@@ -1203,6 +1206,12 @@
 	    }
 	    return if !$bdev;
 
+	    #check multipath           
+	    if (-d "/sys/block/$bdev/holders") { 
+		my $multipathdev = dir_glob_regex ("/sys/block/$bdev/holders", '[A-Za-z]\S*');
+		$bdev = $multipathdev if $multipathdev;
+	    }
+
 	    my $blockdev = find_dev_by_id ("/dev/$bdev");
 	    return if !$blockdev;
 

Modified: pve-storage/trunk/changelog.Debian
===================================================================
--- pve-storage/trunk/changelog.Debian	2010-10-28 10:15:15 UTC (rev 5291)
+++ pve-storage/trunk/changelog.Debian	2010-10-28 10:39:20 UTC (rev 5292)
@@ -1,3 +1,9 @@
+libpve-storage-perl (1.0-15) unstable; urgency=low
+
+  * try to support multipath
+
+ -- Proxmox Support Team <support at proxmox.com>  Thu, 28 Oct 2010 12:38:20 +0200
+
 libpve-storage-perl (1.0-14) unstable; urgency=low
 
   * better caching - avoid timeout bug with large number of VGs.



More information about the pve-devel mailing list