[PATCH 2/2] fcoe: parse yet another sysfs structure for bnx2fc devices (#903122)

Radek Vykydal rvykydal at redhat.com
Fri Jan 24 11:09:35 UTC 2014


The patch is needed to parse-out correct parent nic used for FCoE,
which is used for setting dracut arguments and pre-reboot tweaking
of ifcfg file of parent device (NM_CONTROLLED=no, ONBOOT=yes)

Related: rhbz#903122
---
 blivet/udev.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/blivet/udev.py b/blivet/udev.py
index 93bb8bd..9c8953d 100644
--- a/blivet/udev.py
+++ b/blivet/udev.py
@@ -681,6 +681,8 @@ def udev_device_get_iscsi_initiator(info):
 # This is completely different for Broadcom FCoE devices (bnx2fc), where we use
 # the sysfs path:
 # /devices/pci0000:00/0000:00:03.0/0000:04:00.3/net/eth3/ctlr_0/host5/rport-5:0-3/target5:0:1/5:0:1:147/block/sdb
+# and sometimes:
+# /devices/virtual/net/p2p1.802-fcoe/ctlr_0/host7/rport-7:0-5/target7:0:2/7:0:2:0/block/sdb
 # and find whether the host has 'fc_host' and if it the device has a bound
 # Ethernet interface.
 
@@ -731,7 +733,7 @@ def udev_device_get_fcoe_nic(info):
             log.warning("unexpected sysfs_path of bnx2fc device: %s" % info['sysfs_path'])
             match = re.compile(r'.*/net/([^/]*)').match(info['sysfs_path'])
             if match:
-                return match.groups()[0]
+                return match.groups()[0].split(".")[0]
         else:
             return iface
 
-- 
1.7.11.7



More information about the anaconda-patches mailing list