@@ -105,6 +105,7 @@ func parseSessions(lines string) []iscsiSession {
105105}
106106
107107func sessionExists (tgtPortal , tgtIQN string ) (bool , error ) {
108+ debug .Printf ("Begin sessionExists (%s/%s)...\n " , tgtIQN , tgtPortal )
108109 sessions , err := getCurrentSessions ()
109110 if err != nil {
110111 return false , err
@@ -147,6 +148,7 @@ func waitForPathToExist(devicePath *string, maxRetries, intervalSeconds int, dev
147148}
148149
149150func waitForPathToExistImpl (devicePath * string , maxRetries , intervalSeconds int , deviceTransport string , osStat statFunc , filepathGlob globFunc ) (bool , error ) {
151+ debug .Printf ("waitForPathToExistImpl (%v)" , * devicePath )
150152 if devicePath == nil || * devicePath == "" {
151153 return false , fmt .Errorf ("unable to check nil or unspecified devicePath" )
152154 }
@@ -197,6 +199,8 @@ func getMultipathDisk(path string) (string, error) {
197199 return "" , err
198200 }
199201 sdevice := filepath .Base (devicePath )
202+ debug .Printf ("-- devicePath=%s, sdevice=%s" , devicePath , sdevice )
203+
200204 // If destination directory is already identified as a multipath device,
201205 // just return its path
202206 if strings .HasPrefix (sdevice , "dm-" ) {
@@ -207,13 +211,14 @@ func getMultipathDisk(path string) (string, error) {
207211 // check to see if any have an entry under /sys/block/dm-*/slaves matching
208212 // the device the symlink was pointing at
209213 dmPaths , err := filepath .Glob ("/sys/block/dm-*" )
214+ debug .Printf ("-- dmPaths=%v" , dmPaths )
210215 if err != nil {
211216 debug .Printf ("Glob error: %s" , err )
212217 return "" , err
213218 }
214219 for _ , dmPath := range dmPaths {
215220 sdevices , err := filepath .Glob (filepath .Join (dmPath , "slaves" , "*" ))
216- debug .Printf ("dmPath=%v, sdevices=%v" , dmPath , sdevices )
221+ debug .Printf ("dmPath=%v/slaves/* , sdevices=%v" , dmPath , sdevices )
217222 if err != nil {
218223 debug .Printf ("Glob error: %s" , err )
219224 }
@@ -224,7 +229,7 @@ func getMultipathDisk(path string) (string, error) {
224229 // We've found a matching entry, return the path for the
225230 // dm-* device it was found under
226231 p := filepath .Join ("/dev" , filepath .Base (dmPath ))
227- debug .Printf ("Found matching multipath device: %s under dm-* device path %s " , sdevice , dmPath )
232+ debug .Printf ("Found matching multipath device (%s) under dm-* device path (%s), (%v) " , sdevice , dmPath , p )
228233 return p , nil
229234 }
230235 }
@@ -236,6 +241,7 @@ func getMultipathDisk(path string) (string, error) {
236241// Connect attempts to connect a volume to this node using the provided Connector info
237242func Connect (c * Connector ) (string , error ) {
238243 var lastErr error
244+ debug .Printf ("Begin iSCSI Connect (dDoDiscovery=%v)...\n " , c .DoDiscovery )
239245 if c .RetryCount == 0 {
240246 c .RetryCount = 10
241247 }
0 commit comments