Merge branch 'master' of https://github.com/TheGrandWazoo/freenas-proxmox.git
This commit is contained in:
		
						commit
						a6906fe4d6
					
				|  | @ -52,6 +52,9 @@ sub run_lun_command { | ||||||
|     if($method eq "list_view") { |     if($method eq "list_view") { | ||||||
|         return run_list_view($scfg, $timeout, $method, @params); |         return run_list_view($scfg, $timeout, $method, @params); | ||||||
|     } |     } | ||||||
|  |     if($method eq "list_extent") { | ||||||
|  |         return run_list_extent($scfg, $timeout, $method, @params); | ||||||
|  |     } | ||||||
|     if($method eq "list_lu") { |     if($method eq "list_lu") { | ||||||
|         return run_list_lu($scfg, $timeout, $method, "name", @params); |         return run_list_lu($scfg, $timeout, $method, "name", @params); | ||||||
|     } |     } | ||||||
|  | @ -109,6 +112,29 @@ sub run_list_lu { | ||||||
|     return $result; |     return $result; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | # | ||||||
|  | # | ||||||
|  | # | ||||||
|  | sub run_list_extent { | ||||||
|  |     my ($scfg, $timeout, $method, @params) = @_; | ||||||
|  |     my $object = $params[0]; | ||||||
|  |     my $result = undef; | ||||||
|  | 
 | ||||||
|  |     my $luns = freenas_list_lu($scfg); | ||||||
|  |     foreach my $lun (@$luns) { | ||||||
|  |         if ($lun->{'iscsi_target_extent_path'} =~ /^$object$/) { | ||||||
|  |             $result = $lun->{'iscsi_target_extent_naa'}; | ||||||
|  |             syslog("info","FreeNAS::list_extent($object): naa found $result"); | ||||||
|  |             last; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |     if(!defined($result)) { | ||||||
|  |       syslog("info","FreeNAS::list_extent($object): naa not found"); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     return $result; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| # | # | ||||||
| # | # | ||||||
| # | # | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue