[pve-devel] r5064 - pve-storage/pve2

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Aug 26 12:44:34 CEST 2010


Author: dietmar
Date: 2010-08-26 10:44:32 +0000 (Thu, 26 Aug 2010)
New Revision: 5064

Modified:
   pve-storage/pve2/ChangeLog
   pve-storage/pve2/Storage.pm
Log:
	(foreach_volid): re-add, slightly modified


Modified: pve-storage/pve2/ChangeLog
===================================================================
--- pve-storage/pve2/ChangeLog	2010-08-26 10:32:29 UTC (rev 5063)
+++ pve-storage/pve2/ChangeLog	2010-08-26 10:44:32 UTC (rev 5064)
@@ -2,6 +2,7 @@
 
 	* Storage.pm (vdisk_list): return full volid instead of volume name.
 	(template_list): return full volid instead of volume name.
+	(foreach_volid): re-add, slightly modified
 
 2010-08-25  Proxmox Support Team  <support at proxmox.com>
 

Modified: pve-storage/pve2/Storage.pm
===================================================================
--- pve-storage/pve2/Storage.pm	2010-08-26 10:32:29 UTC (rev 5063)
+++ pve-storage/pve2/Storage.pm	2010-08-26 10:44:32 UTC (rev 5064)
@@ -2542,4 +2542,22 @@
     return undef;
 }
 
+sub foreach_volid {
+    my ($list, $func) = @_;
+
+    return if !$list;
+
+    foreach my $sid (keys %$list) {
+       foreach my $info (@{$list->{$sid}}) {
+           my $volid = $info->{volid};
+	   my ($sid1, $volname) = parse_volume_id ($volid, 1);
+	   if ($sid1 && $sid1 eq $sid) {
+	       &$func ($volid, $sid, $info);
+	   } else {
+	       warn "detected strange volid '$volid' in volume list for '$sid'\n";
+	   }
+       }
+    }
+}
+
 1;




More information about the pve-devel mailing list