Skip to content

Commit be0a528

Browse files
committed
Remove code conditional on mpp_luncheck.is_RdacLun which has only ever returned False for some time
Signed-off-by: Mark Syms <mark.syms@citrix.com>
1 parent 0357016 commit be0a528

File tree

11 files changed

+33
-360
lines changed

11 files changed

+33
-360
lines changed

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ SM_LIBS += metadata
5353
SM_LIBS += lvmanager
5454
SM_LIBS += blktap2
5555
SM_LIBS += mpp_mpathutil
56-
SM_LIBS += mpp_luncheck
57-
SM_LIBS += updatempppathd
5856
SM_LIBS += lcache
5957
SM_LIBS += resetvdis
6058
SM_LIBS += B_util
@@ -157,8 +155,6 @@ install: precheck
157155
$(SM_STAGING)/$(INIT_DIR)
158156
install -m 644 etc/logrotate.d/$(SMLOG_CONF) \
159157
$(SM_STAGING)/$(LOGROTATE_DIR)
160-
install -m 644 drivers/updatempppathd.service \
161-
$(SM_STAGING)/$(SYSTEMD_SERVICE_DIR)
162158
install -m 644 etc/make-dummy-sr.service \
163159
$(SM_STAGING)/$(SYSTEMD_SERVICE_DIR)
164160
install -m 644 snapwatchd/snapwatchd.service \

drivers/LVHDoHBASR.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import scsiutil
3030
import mpath_cli
3131
import glob
32-
import mpp_luncheck
3332

3433
CAPABILITIES = ["SR_PROBE", "SR_UPDATE", "SR_METADATA", "SR_TRIM",
3534
"VDI_CREATE", "VDI_DELETE", "VDI_ATTACH", "VDI_DETACH",
@@ -160,15 +159,7 @@ def probe(self):
160159
pass
161160

162161
if self.dconf['SCSIid'] in maps:
163-
if (mpp_luncheck.is_RdacLun(self.dconf['SCSIid'])):
164-
mpath_cli.remove_map(self.dconf['SCSIid'])
165-
else:
166-
raise xs_errors.XenError('SRInUse')
167-
else:
168-
if (mpp_luncheck.is_RdacLun(self.dconf['SCSIid'])):
169-
link=glob.glob('/dev/disk/mpInuse/%s-*' % self.dconf['SCSIid'])
170-
if (len(link)):
171-
raise xs_errors.XenError('SRInUse')
162+
raise xs_errors.XenError('SRInUse')
172163

173164
self.mpathmodule.refresh(self.SCSIid,0)
174165

drivers/LVHDoISCSISR.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import xmlrpclib
2626
import mpath_cli, iscsilib
2727
import glob, copy
28-
import mpp_luncheck
2928
import scsiutil
3029
import xml.dom.minidom
3130

@@ -397,18 +396,11 @@ def _LUNprint(self, sr_uuid):
397396
nluns=len(luns)-1 # remove the line relating to the final \n
398397
# check if the LUNs are MPP-RDAC Luns
399398
scsi_id = scsiutil.getSCSIid(sgdev)
400-
mpp_lun = False
401-
if (mpp_luncheck.is_RdacLun(scsi_id)):
402-
mpp_lun = True
403-
link=glob.glob('/dev/disk/by-scsibus/%s-*' % scsi_id)
404-
mpp_adapter = link[0].split('/')[-1].split('-')[-1].split(':')[0]
405399

406400
# make sure we've got that many sg devices present
407401
for i in range(0,30):
408402
luns=scsiutil._dosgscan()
409403
sgdevs=filter(lambda r: r[1]==adapter, luns)
410-
if mpp_lun:
411-
sgdevs.extend(filter(lambda r: r[1]==mpp_adapter, luns))
412404
if len(sgdevs)>=nluns:
413405
util.SMlog("Got all %d sg devices" % nluns)
414406
break
@@ -542,22 +534,13 @@ def probe(self):
542534
# as this will remove it (which may well be in use).
543535
if self.mpath == 'true' and self.dconf.has_key('SCSIid'):
544536
maps = []
545-
mpp_lun = False
546537
try:
547-
if (mpp_luncheck.is_RdacLun(self.dconf['SCSIid'])):
548-
mpp_lun = True
549-
link=glob.glob('/dev/disk/mpInuse/%s-*' % self.dconf['SCSIid'])
550-
else:
551-
maps = mpath_cli.list_maps()
538+
maps = mpath_cli.list_maps()
552539
except:
553540
pass
554541

555-
if (mpp_lun):
556-
if (len(link)):
557-
raise xs_errors.XenError('SRInUse')
558-
else:
559-
if self.dconf['SCSIid'] in maps:
560-
raise xs_errors.XenError('SRInUse')
542+
if self.dconf['SCSIid'] in maps:
543+
raise xs_errors.XenError('SRInUse')
561544

562545
self.iscsi.attach(self.uuid)
563546
if not self.iscsi._attach_LUN_bySCSIid(self.SCSIid):

drivers/OCFSoISCSISR.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import xmlrpclib
2626
import mpath_cli, iscsilib
2727
import glob, copy
28-
import mpp_luncheck
2928
import scsiutil
3029
import xml.dom.minidom
3130

@@ -383,18 +382,11 @@ def _LUNprint(self, sr_uuid):
383382
nluns=len(luns)-1 # remove the line relating to the final \n
384383
# check if the LUNs are MPP-RDAC Luns
385384
scsi_id = scsiutil.getSCSIid(sgdev)
386-
mpp_lun = False
387-
if (mpp_luncheck.is_RdacLun(scsi_id)):
388-
mpp_lun = True
389-
link=glob.glob('/dev/disk/by-scsibus/%s-*' % scsi_id)
390-
mpp_adapter = link[0].split('/')[-1].split('-')[-1].split(':')[0]
391385

392386
# make sure we've got that many sg devices present
393387
for i in range(0,30):
394388
luns=scsiutil._dosgscan()
395389
sgdevs=filter(lambda r: r[1]==adapter, luns)
396-
if mpp_lun:
397-
sgdevs.extend(filter(lambda r: r[1]==mpp_adapter, luns))
398390
if len(sgdevs)>=nluns:
399391
util.SMlog("Got all %d sg devices" % nluns)
400392
break

drivers/mpath_dmp.py

Lines changed: 5 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import glob
2424
import time
2525
import scsiutil
26-
import mpp_luncheck
2726
import wwid_conf
2827
import errno
2928

@@ -37,7 +36,6 @@
3736
DEVBYSCSIPATH = "/dev/disk/by-scsibus"
3837
DEVBYMPPPATH = "/dev/disk/by-mpp"
3938
SYSFS_PATH='/sys/class/scsi_host'
40-
UMPD_PATH='/var/run/updatempppathd.py.pid'
4139
MP_INUSEDIR = "/dev/disk/mpInuse"
4240

4341
MPPGETAIDLNOBIN = "/opt/xensource/bin/xe-get-arrayid-lunnum"
@@ -47,14 +45,6 @@ def _is_mpath_daemon_running():
4745
(rc,stdout,stderr) = util.doexec(cmd)
4846
return (rc==0)
4947

50-
def _is_mpp_daemon_running():
51-
#cmd = ["/sbin/pidof", "-s", "/opt/xensource/sm/updatempppathd.py"]
52-
#(rc,stdout,stderr) = util.doexec(cmd)
53-
if os.path.exists(UMPD_PATH):
54-
return True
55-
else:
56-
return False
57-
5848
def activate_MPdev(sid, dst):
5949
try:
6050
os.mkdir(MP_INUSEDIR)
@@ -63,34 +53,18 @@ def activate_MPdev(sid, dst):
6353
pass
6454
else:
6555
raise
66-
if (mpp_luncheck.is_RdacLun(sid)):
67-
suffix = get_TargetID_LunNUM(sid)
68-
sid_with_suffix = sid + "-" + suffix
69-
path = os.path.join(MP_INUSEDIR, sid_with_suffix)
70-
else:
71-
path = os.path.join(MP_INUSEDIR, sid)
56+
path = os.path.join(MP_INUSEDIR, sid)
7257
cmd = ['ln', '-sf', dst, path]
7358
util.pread2(cmd)
7459

7560
def deactivate_MPdev(sid):
76-
if (mpp_luncheck.is_RdacLun(sid)):
77-
pathlist = glob.glob('/dev/disk/mpInuse/%s-*' % sid)
78-
path = pathlist[0]
79-
else:
80-
path = os.path.join(MP_INUSEDIR, sid)
61+
path = os.path.join(MP_INUSEDIR, sid)
8162
if os.path.exists(path):
8263
os.unlink(path)
8364

8465
def reset(sid,explicit_unmap=False,delete_nodes=False):
8566
util.SMlog("Resetting LUN %s" % sid)
86-
if (mpp_luncheck.is_RdacLun(sid)):
87-
_resetMPP(sid,explicit_unmap)
88-
else:
89-
_resetDMP(sid,explicit_unmap,delete_nodes)
90-
91-
def _resetMPP(sid,explicit_unmap):
92-
deactivate_MPdev(sid)
93-
return
67+
_resetDMP(sid,explicit_unmap,delete_nodes)
9468

9569
def _delete_node(dev):
9670
try:
@@ -200,10 +174,7 @@ def refresh(sid,npaths):
200174
scsiutil.rescan(scsiutil._genHostList(""))
201175
if not util.wait_for_path(path,60):
202176
raise xs_errors.XenError('Device not appeared yet')
203-
if not (mpp_luncheck.is_RdacLun(sid)):
204-
_refresh_DMP(sid,npaths)
205-
else:
206-
_refresh_MPP(sid,npaths)
177+
_refresh_DMP(sid,npaths)
207178
else:
208179
raise xs_errors.XenError('MPath not written yet')
209180

@@ -273,13 +244,6 @@ def _refresh_DMP(sid, npaths):
273244
util.wait_for_path(lvm_path, 10)
274245
activate_MPdev(sid, path)
275246

276-
def _refresh_MPP(sid, npaths):
277-
path = os.path.join(DEVBYMPPPATH,"%s" % sid)
278-
mpppath = glob.glob(path)
279-
if not len(mpppath):
280-
raise xs_errors.XenError('MPP RDAC activate failed to detect mpp path')
281-
activate_MPdev(sid,mpppath[0])
282-
283247
def activate():
284248
util.SMlog("MPATH: multipath activate called")
285249
cmd = ['ln', '-sf', iscsi_mpath_file, iscsi_file]
@@ -296,11 +260,6 @@ def activate():
296260
if iscsilib.is_iscsi_daemon_running():
297261
if not iscsilib._checkAnyTGT():
298262
iscsilib.restart_daemon()
299-
300-
# Start the updatempppathd daemon
301-
if not _is_mpp_daemon_running():
302-
cmd = ["service", "updatempppathd", "start"]
303-
util.pread2(cmd)
304263

305264
if not _is_mpath_daemon_running():
306265
util.SMlog("Warning: multipath daemon not running. Starting daemon!")
@@ -323,11 +282,6 @@ def deactivate():
323282
# Only do this if using our customized open-iscsi package
324283
util.pread2(cmd)
325284

326-
# Stop the updatempppathd daemon
327-
if _is_mpp_daemon_running():
328-
cmd = ["service", "updatempppathd", "stop"]
329-
util.pread2(cmd)
330-
331285
if _is_mpath_daemon_running():
332286
# Flush the multipath nodes
333287
for sid in mpath_cli.list_maps():
@@ -351,16 +305,7 @@ def deactivate():
351305

352306
def path(SCSIid):
353307
if _is_valid_multipath_device(SCSIid) and _is_mpath_daemon_running():
354-
if (mpp_luncheck.is_RdacLun(SCSIid)):
355-
pathlist = glob.glob('/dev/disk/mpInuse/%s-*' % SCSIid)
356-
util.SMlog("pathlist is:")
357-
util.SMlog(pathlist)
358-
if len(pathlist):
359-
path = pathlist[0]
360-
else:
361-
path = os.path.join(MP_INUSEDIR, SCSIid)
362-
else:
363-
path = os.path.join(MP_INUSEDIR, SCSIid)
308+
path = os.path.join(MP_INUSEDIR, SCSIid)
364309
return path
365310
else:
366311
return DEVBYIDPATH + "/scsi-" + SCSIid

drivers/mpathcount.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import xs_errors
2121
import lock
2222
import mpath_cli
23-
import mpp_luncheck
2423
import mpp_mpathutil
2524
import glob
2625
import json
@@ -94,9 +93,6 @@ def _tostring(l):
9493

9594
def get_path_count(SCSIid, active=True):
9695
count = 0
97-
if (mpp_luncheck.is_RdacLun(SCSIid)):
98-
(total_count, active_count) = mpp_mpathutil.get_pathinfo(SCSIid)
99-
return (total_count, active_count)
10096
lines = mpath_cli.get_topology(SCSIid)
10197
for line in filter(match_dmpLUN,lines):
10298
if not active:
@@ -125,20 +121,11 @@ def update_config(key, SCSIid, entry, remove, add, mpp_path_update = False):
125121
add(key,str(entry))
126122
return
127123

128-
rdaclun = False
129-
if (mpp_luncheck.is_RdacLun(SCSIid)):
130-
rdaclun = True
131-
pathlist = glob.glob('/dev/disk/mpInuse/%s-*' % SCSIid)
132-
path = pathlist[0]
133-
else:
134-
path = MP_INUSEDIR + "/" + SCSIid
124+
path = MP_INUSEDIR + "/" + SCSIid
135125
util.SMlog("MPATH: Updating entry for [%s], current: %s" % (SCSIid,entry))
136126
if os.path.exists(path):
137-
if rdaclun:
138-
(total, count) = get_path_count(SCSIid)
139-
else:
140-
count = get_path_count(SCSIid)
141-
total = get_path_count(SCSIid, active=False)
127+
count = get_path_count(SCSIid)
128+
total = get_path_count(SCSIid, active=False)
142129
max = 0
143130
if len(entry) != 0:
144131
try:
@@ -154,9 +141,6 @@ def update_config(key, SCSIid, entry, remove, add, mpp_path_update = False):
154141
if str(newentry) != entry:
155142
remove('multipathed')
156143
remove(key)
157-
if rdaclun:
158-
remove('MPPEnabled')
159-
add('MPPEnabled','true')
160144
add('multipathed','true')
161145
add(key,str(newentry))
162146
util.SMlog("MPATH: Set val: %s" % str(newentry))

drivers/mpp_luncheck.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)