Skip to content

Commit

Permalink
Support IPv6 for NFS ISO SR
Browse files Browse the repository at this point in the history
Location are of form: `[<ipv6>]:/path`

Signed-off-by: BenjiReis <[email protected]>
  • Loading branch information
benjamreis authored and Wescoeur committed Oct 25, 2023
1 parent a637679 commit e67368c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/ISOSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,22 @@ def attach(self, sr_uuid):
# For NFS, do a soft mount with tcp as protocol. Since ISO SR is
# going to be r-only, a failure in nfs link can be reported back
# to the process waiting.
serv_path = location.split(':')
serv_path = []
transport = 'tcp'
if location.startswith('['):
# IPv6 target: remove brackets around the IPv6
transport = 'tcp6'
ip6 = location[1:location.index(']')]
path = location[location.index(']') + 2:]
serv_path = [ip6, path]
else:
serv_path = location.split(':')
util._testHost(serv_path[0], NFSPORT, 'NFSTarget')
# Extract timeout and retrans values, if any
io_timeout = nfs.get_nfs_timeout(self.other_config)
io_retrans = nfs.get_nfs_retrans(self.other_config)
nfs.soft_mount(self.mountpoint, serv_path[0], serv_path[1],
'tcp', useroptions=options, nfsversion=self.nfsversion,
transport, useroptions=options, nfsversion=self.nfsversion,
timeout=io_timeout, retrans=io_retrans)
else:
if self.smbversion in SMB_VERSION_3:
Expand Down

0 comments on commit e67368c

Please sign in to comment.