Skip to content

Commit

Permalink
Remove support for FCoE Storage Repositories
Browse files Browse the repository at this point in the history
Support for FCoE has been removed from upstream distributions and user
space tools so we can no longer support this storage type.

Signed-off-by: Mark Syms <[email protected]>
  • Loading branch information
MarkSymsCtx committed Jan 21, 2025
1 parent 3a2ce72 commit 0203073
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 297 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ SM_DRIVERS += LVHDoISCSI
SM_DRIVERS += LVHDoHBA
SM_DRIVERS += SHM
SM_DRIVERS += SMB
SM_DRIVERS += LVHDoFCoE

SM_LIBS := SR
SM_LIBS += SRCommand
Expand Down Expand Up @@ -56,7 +55,6 @@ SM_LIBS += resetvdis
SM_LIBS += wwid_conf
SM_LIBS += trim_util
SM_LIBS += pluginutil
SM_LIBS += fcoelib
SM_LIBS += constants
SM_LIBS += cbtutil
SM_LIBS += sr_health_check
Expand Down Expand Up @@ -183,7 +181,6 @@ install: precheck
cd $(SM_STAGING)$(SM_DEST) && rm -f RawISCSISR && ln -sf RawISCSISR.py ISCSISR
cd $(SM_STAGING)$(SM_DEST) && rm -f LVHDoISCSISR && ln -sf LVHDoISCSISR.py LVMoISCSISR
cd $(SM_STAGING)$(SM_DEST) && rm -f LVHDoHBASR && ln -sf LVHDoHBASR.py LVMoHBASR
cd $(SM_STAGING)$(SM_DEST) && rm -f LVHDoFCoESR && ln -sf LVHDoFCoESR.py LVMoFCoESR
ln -sf $(SM_DEST)mpathutil.py $(SM_STAGING)/sbin/mpathutil
install -m 755 drivers/02-vhdcleanup $(SM_STAGING)$(MASTER_SCRIPT_DEST)
install -m 755 drivers/lvhd-thin $(SM_STAGING)$(PLUGIN_SCRIPT_DEST)
Expand All @@ -195,7 +192,6 @@ install: precheck
install -m 755 drivers/intellicache-clean $(SM_STAGING)$(PLUGIN_SCRIPT_DEST)
install -m 755 drivers/trim $(SM_STAGING)$(PLUGIN_SCRIPT_DEST)
install -m 755 drivers/iscsilib.py $(SM_STAGING)$(SM_DEST)
install -m 755 drivers/fcoelib.py $(SM_STAGING)$(SM_DEST)
mkdir -p $(SM_STAGING)$(LIBEXEC)
install -m 755 scripts/local-device-change $(SM_STAGING)$(LIBEXEC)
install -m 755 scripts/check-device-sharing $(SM_STAGING)$(LIBEXEC)
Expand Down
99 changes: 0 additions & 99 deletions drivers/LVHDoFCoESR.py

This file was deleted.

2 changes: 1 addition & 1 deletion drivers/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2984,7 +2984,7 @@ def daemonize():
def normalizeType(type):
if type in LVHDSR.SUBTYPES:
type = SR.TYPE_LVHD
if type in ["lvm", "lvmoiscsi", "lvmohba", "lvmofcoe"]:
if type in ["lvm", "lvmoiscsi", "lvmohba"]:
# temporary while LVHD is symlinked as LVM
type = SR.TYPE_LVHD
if type in ["ext", "nfs", "ocfsoiscsi", "ocfsohba", "smb"]:
Expand Down
47 changes: 6 additions & 41 deletions drivers/devscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import xml.dom.minidom
import xs_errors
import glob
import fcoelib

DEVPATH = '/dev/disk/by-id'
DMDEVPATH = '/dev/mapper'
Expand Down Expand Up @@ -50,39 +49,17 @@ def adapters(filterstr="any"):
dict = {}
devs = {}
adt = {}
fcoe_eth_info = {}
fcoe_port_info = []

fcoe_port_info = fcoelib.parse_fcoe_port_name_info()
if filterstr == "fcoe":
fcoe_eth_info = fcoelib.parse_fcoe_eth_info()

for a in os.listdir(SYSFS_PATH1):
proc = match_hbadevs(a, filterstr)
if not proc:
continue

#Special casing for fcoe
port_name_path = os.path.join(SYSFS_PATH1, a, 'device', \
'fc_host', a, 'port_name')
port_name_path_exists = os.path.exists(port_name_path)
util.SMlog("Port name path exists %s" % port_name_path_exists)
if filterstr == "fcoe" and not port_name_path_exists:
continue
if port_name_path_exists:
port_name = _get_port_name(port_name_path)
#If we are probing for fcoe luns/ adapters and if the port name
#in /sys/class/scsi_host/a/device/fc_host/a/port_name does not match
#one in the output of 'fcoeadm -i', then we shouldn't display that
#lun/adapter.
#On the other hand, if we are probing for hba luns, and if the
#port name in /sys/class/scsi_host/a/device/fc_host/a/port_name
#matches one in the output of 'fcoeadm -i', then we shouldn't
#display that lun/adapter, because that would have been discovered
#via the FCoE protocol.
if (filterstr == "fcoe" and port_name not in fcoe_port_info) or \
(filterstr != "fcoe" and port_name in fcoe_port_info):
continue

adt[a] = proc
id = a.replace("host", "")
Expand All @@ -96,7 +73,6 @@ def adapters(filterstr="any"):
for p in [os.path.join(SYSFS_PATH1, a, "device", "session*"), os.path.join(SYSFS_PATH1, a, "device"), \
os.path.join(SYSFS_PATH2, "%s:*" % id)]:
paths += glob.glob(p)

if not len(paths):
continue
for path in paths:
Expand Down Expand Up @@ -124,12 +100,8 @@ def adapters(filterstr="any"):
for lun in os.listdir(sysfs):
if not match_LUNs(lun, tgt):
continue
#Special casing for fcoe, populating eth information
eth = ""
if i in fcoe_eth_info.keys():
eth = fcoe_eth_info[i]
dir = os.path.join(sysfs, lun, "device")
(dev, entry) = _extract_dev(dir, proc, id, lun, eth)
dir = os.path.join(sysfs,lun,"device")
(dev, entry) = _extract_dev(dir, proc, id, lun)
update_devs_dict(devs, dev, entry)

# for new mptsas sysfs entries, check for phy* node
Expand Down Expand Up @@ -218,9 +190,8 @@ def _parseHostId(str):
def match_hbadevs(s, filterstr):
driver_name = _get_driver_name(s)
if match_host(s) and not match_blacklist(driver_name) \
and (filterstr == "any" or filterstr == "fcoe" or \
match_filterstr(filterstr, driver_name)):
return driver_name
and ( filterstr == "any" or match_filterstr(filterstr, driver_name) ):
return driver_name
else:
return ""

Expand Down Expand Up @@ -275,15 +246,13 @@ def _get_block_device_name_with_kernel_3x(device_dir):
else:
return INVALID_DEVICE_NAME


def _extract_dev(device_dir, procname, host, target, eths=""):
def _extract_dev(device_dir, procname, host, target):
"""Returns device name and creates dictionary entry for it"""
dev = _extract_dev_name(device_dir)
entry = {}
entry['procname'] = procname
entry['host'] = host
entry['target'] = target
entry['eth'] = eths
return (dev, entry)


Expand Down Expand Up @@ -349,8 +318,6 @@ def scan(srobj):
obj.id = ids[3]
obj.lun = ids[4]
obj.hba = hba['procname']
if 'eth' in hba and hba['eth']:
obj.eth = hba['eth']
obj.numpaths = 1
if obj.SCSIid in vdis:
vdis[obj.SCSIid].numpaths += 1
Expand All @@ -363,12 +330,10 @@ def scan(srobj):
d = dom.createElement("BlockDevice")
e.appendChild(d)

for attr in ['path', 'numpaths', 'SCSIid', 'vendor', 'serial', 'size', 'adapter', 'channel', 'id', 'lun', 'hba', 'eth']:
for attr in ['path', 'numpaths', 'SCSIid', 'vendor', 'serial', 'size', 'adapter', 'channel', 'id', 'lun', 'hba']:
try:
aval = getattr(obj, attr)
except AttributeError:
if attr in ['eth']:
continue
raise xs_errors.XenError('InvalidArg',
opterr='Missing required field [%s]' % attr)
entry = dom.createElement(attr)
Expand Down
63 changes: 0 additions & 63 deletions drivers/fcoelib.py

This file was deleted.

2 changes: 1 addition & 1 deletion drivers/mpathcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import mpath_cli
import json

supported = ['iscsi', 'lvmoiscsi', 'rawhba', 'lvmohba', 'ocfsohba', 'ocfsoiscsi', 'netapp', 'lvmofcoe', 'gfs2']
supported = ['iscsi', 'lvmoiscsi', 'rawhba', 'lvmohba', 'ocfsohba', 'ocfsoiscsi', 'netapp', 'gfs2']

LOCK_TYPE_HOST = "host"
LOCK_NS1 = "mpathcount1"
Expand Down
3 changes: 0 additions & 3 deletions mk/sm.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ tests/run_python_unittests.sh
/opt/xensource/sm/LVHDSR.py
/opt/xensource/sm/LVHDoHBASR.py
/opt/xensource/sm/LVHDoISCSISR.py
/opt/xensource/sm/LVHDoFCoESR.py
/opt/xensource/sm/LVMSR
/opt/xensource/sm/LVMoHBASR
/opt/xensource/sm/LVMoISCSISR
/opt/xensource/sm/LVMoFCoESR
/opt/xensource/sm/NFSSR
/opt/xensource/sm/NFSSR.py
/opt/xensource/sm/SMBSR
Expand All @@ -168,7 +166,6 @@ tests/run_python_unittests.sh
/opt/xensource/sm/flock.py
/opt/xensource/sm/ipc.py
/opt/xensource/sm/iscsilib.py
/opt/xensource/sm/fcoelib.py
/opt/xensource/sm/journaler.py
/opt/xensource/sm/lcache.py
/opt/xensource/sm/lock.py
Expand Down
Loading

0 comments on commit 0203073

Please sign in to comment.