Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package powerpc-utils for openSUSE:Factory 
checked in at 2022-01-07 12:45:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old)
 and      /work/SRC/openSUSE:Factory/.powerpc-utils.new.1896 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "powerpc-utils"

Fri Jan  7 12:45:05 2022 rev:121 rq:944111 version:1.3.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes      
2021-12-06 23:59:46.304481745 +0100
+++ /work/SRC/openSUSE:Factory/.powerpc-utils.new.1896/powerpc-utils.changes    
2022-01-07 12:45:47.807821107 +0100
@@ -1,0 +2,10 @@
+Wed Jan  5 19:10:13 UTC 2022 - Michal Suchanek <msucha...@suse.com>
+
+- Add support for vnic backup device for HNV (jsc#SLE-23097).
+   + 0001-hcnmgr-Support-vNIC-as-backup-device.patch
+   + 0002-hcnmgr-Remove-some-dead-code.patch
+- Add support for NVMf devices (jsc#SLE-18643).
+   + 0003-ofpathname-Fix-nvme-support-in-ANA-mode.patch
+   + 0004-ofpathname-Add-support-for-NVMf-devices.patch
+
+-------------------------------------------------------------------

New:
----
  0001-hcnmgr-Support-vNIC-as-backup-device.patch
  0002-hcnmgr-Remove-some-dead-code.patch
  0003-ofpathname-Fix-nvme-support-in-ANA-mode.patch
  0004-ofpathname-Add-support-for-NVMf-devices.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ powerpc-utils.spec ++++++
--- /var/tmp/diff_new_pack.6SxyKs/_old  2022-01-07 12:45:48.383821507 +0100
+++ /var/tmp/diff_new_pack.6SxyKs/_new  2022-01-07 12:45:48.399821518 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package powerpc-utils
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -30,6 +30,10 @@
 Patch4:         libvirt-service-dep.patch
 Patch5:         lsdevinfo-optimize-criteria-filtering.patch
 Patch6:         hcnmgr-Avoid-hexdum-squeezing-consecutive-identical-.patch
+Patch7:         0001-hcnmgr-Support-vNIC-as-backup-device.patch
+Patch8:         0002-hcnmgr-Remove-some-dead-code.patch
+Patch9:         0003-ofpathname-Fix-nvme-support-in-ANA-mode.patch
+Patch10:        0004-ofpathname-Add-support-for-NVMf-devices.patch
 Patch14:        fix_kexec_service_name_for_suse.patch
 BuildRequires:  autoconf
 BuildRequires:  automake

++++++ 0001-hcnmgr-Support-vNIC-as-backup-device.patch ++++++
>From 6951f22553e646ae88b78103427f2f52e846e538 Mon Sep 17 00:00:00 2001
From: Mingming Cao <m...@linux.vnet.ibm.com>
Date: Tue, 9 Nov 2021 15:45:44 -0800
Subject: [PATCH 1/4] hcnmgr: Support vNIC as backup device

References: jsc#SLE-23097
Upstream: accepted (expected in 1.3.10)
Git-commit: 6951f22553e646ae88b78103427f2f52e846e538

HNV version 1.0 supports ibmveth as backup device for HNV.

As ibmvnic is more stablized, enable support for vnic as backup
vdevice for HNV in new version 1.1

Signed-off-by: Mingming Cao <m...@linux.vnet.ibm.com>
Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com>
---
 scripts/hcnmgr | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/hcnmgr b/scripts/hcnmgr
index 4386084..0742a97 100644
--- a/scripts/hcnmgr
+++ b/scripts/hcnmgr
@@ -21,7 +21,7 @@
 #         support live partition migration with SR_IOV
 #
 
-VERSION="1.0"
+VERSION="1.1"
 PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin
 BOND_BASEPATH="/sys/class/net"
 BONDOPTIONS="mode=1,miimon=100,fail_over_mac=2"
@@ -661,6 +661,9 @@ fi
 if ! nmcli --version >/dev/null 2>&1; then
        err $E_ENETUNREACH
 fi
+# HNV can support VNIC or Veth as backup device.
+# In the first HNV version 1.0, the vNIC as backup support was turned off
+# HNV VERSION greater than 1.0 starts to support vNIC as the backup device
 if [[ $VERSION == "1.0" ]]; then
        VNIC_SPT="OFF"
 fi
-- 
2.34.1


++++++ 0002-hcnmgr-Remove-some-dead-code.patch ++++++
>From 1e23f0265608f49679a462072d3a4f17139edfc0 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msucha...@suse.de>
Date: Tue, 30 Nov 2021 12:04:37 +0100
Subject: [PATCH 2/4] hcnmgr: Remove some dead code

References: jsc#SLE-23097
Upstream: accepted (expected in 1.3.10)
Git-commit: 1e23f0265608f49679a462072d3a4f17139edfc0

There is VNIC_SPT which enables support for vnic as beckup device which
is set based on value of VERSION variable which is hardcoded in the
script and does not correspond the actual HNV support level on the LPAR.

Remove all this. We do support vnic backend so enable it
unconditionally.

It is the job of HMC to decide if vnic backup device is supported and
can be configured. When it is configured by HMC make use of it.

Signed-off-by: Michal Suchanek <msucha...@suse.de>
Reviewed-by: Mingming Cao <m...@linux.vnet.ibm.com>
Tested-by: Mingming Cao <m...@linux.vnet.ibm.com>
Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com>
---
 scripts/hcnmgr | 43 +++++++++++++++----------------------------
 1 file changed, 15 insertions(+), 28 deletions(-)

diff --git a/scripts/hcnmgr b/scripts/hcnmgr
index 0742a97..870f544 100644
--- a/scripts/hcnmgr
+++ b/scripts/hcnmgr
@@ -21,7 +21,7 @@
 #         support live partition migration with SR_IOV
 #
 
-VERSION="1.1"
+FEATURES="vnic"
 PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin
 BOND_BASEPATH="/sys/class/net"
 BONDOPTIONS="mode=1,miimon=100,fail_over_mac=2"
@@ -39,7 +39,6 @@ MODE=""
 PHYSLOC=""
 DEVPATH=""
 VIO_TYPE=""
-VNIC_SPT=""
 
 # Usage statements
 usage() {
@@ -71,9 +70,9 @@ usage() {
 
 # Display current version of hybrid network support
 show_version() {
-       echo "$HCNMGR: Version $VERSION"
+       echo "$HCNMGR (features: $FEATURES)"
        echo "Written by: Mingming Cao <mingming....@ibm.com>"
-       hcnlog INFO "HCN_VERSION=$VERSION"
+       hcnlog INFO "$HCNMGR (features: $FEATURES)"
 }
 
 # Error codes
@@ -365,10 +364,6 @@ cfghcn() {
 
        hcnlog DEBUG "cfghcn: enter $1"
        search_dev "$1"
-       if [[ $VIO_TYPE == "VNIC" && $VNIC_SPT == "OFF" ]]; then
-               hcnlog WARN "Backing device $VIO_TYPE for Migratable VF is not 
supported in hcnmgr version $VERSION"
-               err $E_INVAL_DEV
-       fi
        while [ $retry != 0 ]; do
                hcnlog DEBUG "cfg_hcn: calling do_confi_vdevice to enslave 
$DEVNAME to HNV"
                if do_config_vdevice; then
@@ -596,20 +591,18 @@ scanhcn() {
                fi
        done
 
-       if [[ $VNIC_SPT != "OFF" ]]; then
-               hcnlog DEBUG "search vnic device with ibm,hcn-id 
propterty......"
-               # Look at every vNIC device with ibm,hcn-id propterty
-               # join or create bond for this hcnid if not exist, add vnic 
device as
-               # slave for this bond accosiated with hcnid, if not already to
-               for dev in "$DT_PATH"/vdevice/vnic*; do
-                       [ -d "$dev" ] || continue
-                       if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then
-                               hcnlog DEBUG "scanhcn found vnic device with 
hcnid "
-                               hcnlog INFO "scanhcn configure HCN and vnic 
device"
-                               do_config_vdevice
-                       fi
-               done
-       fi
+       hcnlog DEBUG "search vnic device with ibm,hcn-id propterty......"
+       # Look at every vNIC device with ibm,hcn-id propterty
+       # join or create bond for this hcnid if not exist, add vnic device as
+       # slave for this bond accosiated with hcnid, if not already to
+       for dev in "$DT_PATH"/vdevice/vnic*; do
+               [ -d "$dev" ] || continue
+               if [ -e "$dev"/ibm,hcn-id ] && get_dev_hcn "$dev"; then
+                       hcnlog DEBUG "scanhcn found vnic device with hcnid "
+                       hcnlog INFO "scanhcn configure HCN and vnic device"
+                       do_config_vdevice
+               fi
+       done
 
        if [ ${#HcnIds[@]} -eq 0 ]; then
                hcnlog DEBUG "scanhcn: scan for hybrid virtual network finished"
@@ -661,12 +654,6 @@ fi
 if ! nmcli --version >/dev/null 2>&1; then
        err $E_ENETUNREACH
 fi
-# HNV can support VNIC or Veth as backup device.
-# In the first HNV version 1.0, the vNIC as backup support was turned off
-# HNV VERSION greater than 1.0 starts to support vNIC as the backup device
-if [[ $VERSION == "1.0" ]]; then
-       VNIC_SPT="OFF"
-fi
 
 #Validate bonding module is loaded
 if ! lsmod | grep -q bonding; then
-- 
2.34.1


++++++ 0003-ofpathname-Fix-nvme-support-in-ANA-mode.patch ++++++
>From 98c8519b832ddb93021c3eeb8eee0f5e51c49197 Mon Sep 17 00:00:00 2001
From: Wen Xiong <wenxi...@linux.ibm.com>
Date: Thu, 30 Sep 2021 08:53:13 -0500
Subject: [PATCH 3/4] ofpathname: Fix nvme support in ANA mode

References: jsc#SLE-18643
Upstream: accepted (expected in 1.3.10)
Git-commit: 98c8519b832ddb93021c3eeb8eee0f5e51c49197

nvme_core.multipath is Y by defaut in the latest rhel
and sles linux release. The patch fixes the issue when
nvme_core.multipath=Y

Signed-off-by: Wen Xiong <wenxi...@linux.ibm.com>
Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com>
---
 scripts/ofpathname | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/scripts/ofpathname b/scripts/ofpathname
index c4d81f2..310ee3e 100755
--- a/scripts/ofpathname
+++ b/scripts/ofpathname
@@ -640,6 +640,7 @@ l2of_nvme()
     # disk: nvmeX, nvmeXnY; not nvmeXnYpZ
     local devdisk="${DEVICE%p[0-9]*}"
 
+    local dev_ctrl=${devdisk%n[0-9]*}
     # namespace id: Y in nvmeXnY, nvmeXnYpZ
     local devnsid="${devdisk#nvme[0-9]*n}"
     if [[ $devnsid = $devdisk ]]; then
@@ -656,7 +657,7 @@ l2of_nvme()
     local dir
     local found=0
 
-    for dir in `$FIND /sys/devices -name "$DEVICE"`; do
+    for dir in `$FIND /sys/devices -name "$dev_ctrl"`; do
         cd $dir
 
         goto_dir $PWD "device/devspec"
@@ -666,8 +667,10 @@ l2of_nvme()
             found=1
             if [[ -n $devnsid ]]; then
                 # Linux logical nsid might not match nvme controller nsid
-                goto_dir $dir "nsid"
-                devnsid=`$CAT $PWD/nsid | tr -d '\000'`
+                for nsid_dir in `$FIND /sys/devices -name "DEVICE"`; do
+                    goto_dir $dir_dir "nsid"
+                    devnsid=`$CAT $PWD/nsid | tr -d '\000'`
+                done
             fi
             break
         fi
@@ -1056,7 +1059,8 @@ ofpathname_to_logical()
 
     # Remove any possible partition reference
     PART=$(expr "$DEVICE" : '.*\(:[0-9]\)')
-    if [[ -n $PART ]] ; then
+    if [[ -n $PART ]] && \
+    [[ $DEVTYPE != "nvme" ]]; then
         PART=${PART:1}
         DEVICE=${DEVICE%:[0-9]}
     fi
@@ -1083,7 +1087,8 @@ ofpathname_to_logical()
     fi
 
     # Add any previously stripped partition reference
-    if [[ -n $PART ]] ; then
+    if [[ -n $PART ]] && \
+    [[ $DEVTYPE != "nvme" ]]; then
         LOGICAL_DEVNAME=$LOGICAL_DEVNAME$PART
     fi
 
@@ -1650,6 +1655,10 @@ of2l_nvme()
             continue
         fi
 
+        if [[ "$PWD" == *"nvme-fabrics"* ]]; then
+            continue
+        fi
+
         goto_dir $PWD "devspec"
         local devspec=`$CAT ./devspec 2>/dev/null`
 
-- 
2.34.1


++++++ 0004-ofpathname-Add-support-for-NVMf-devices.patch ++++++
>From 8a10a623a781ed3e56d0e7fecec7a035bb9e9755 Mon Sep 17 00:00:00 2001
From: Wen Xiong <wenxi...@linux.ibm.com>
Date: Thu, 30 Sep 2021 08:53:14 -0500
Subject: [PATCH 4/4] ofpathname: Add support for NVMf devices

References: jsc#SLE-18643
Upstream: accepted (expected in 1.3.10)
Git-commit: 8a10a623a781ed3e56d0e7fecec7a035bb9e9755

To support boot/installtion over nvme-over-fc devices.
This patch converts a NVMf device name between open firmware device path
and logical device.

Signed-off-by: Wen Xiong <wenxi...@linux.ibm.com>
Reviewed-by: Brian King <brk...@linux.ibm.com>
[tyreld: removed trailing whitespace]
Signed-off-by: Tyrel Datwyler <tyr...@linux.ibm.com>
---
 scripts/ofpathname | 209 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 206 insertions(+), 3 deletions(-)

diff --git a/scripts/ofpathname b/scripts/ofpathname
index 310ee3e..b1d6b09 100755
--- a/scripts/ofpathname
+++ b/scripts/ofpathname
@@ -30,6 +30,7 @@ OFPATHNAME="ofpathname"
 VERSION="0.5"
 FIND=/usr/bin/find
 CAT=/bin/cat
+LSPROP=/sbin/lsprop
 PSERIES_PLATFORM=$(dirname $0)/pseries_platform
 
 # Find out what platfrom we are running on.  Hopefully this
@@ -414,6 +415,21 @@ is_net_interface()
     fi
 }
 
+# is_nvmf_device
+# Check to see if this is a nvmf device
+#
+is_nvmf_device()
+{
+    local res
+
+    res=`$FIND /sys/devices/virtual/nvme-fabrics -name $1 2>/dev/null`
+    if [[ ${#res} = 0 ]]; then
+           echo "no"
+    else
+           echo "yes"
+    fi
+}
+
 #
 # logical_to_ofpathname
 # Conversion for logical device name to an Open Firmware device path
@@ -466,7 +482,14 @@ logical_to_ofpathname()
                     logical_to_ofpathname
                     exit
                     ;;
-       nvme*)      l2of_nvme ;;
+        nvme*)     #check if the device is a nvmf device
+                    local ctrl_name="${DEVICE%n[0-9]*}"
+                    is_nvmf=$(is_nvmf_device $ctrl_name)
+                    if [[ $is_nvmf = "yes" ]]; then
+                        l2of_nvmf
+                    else
+                        l2of_nvme
+                    fi ;;
        *)         # check if the device is a network interface
                    is_net=$(is_net_interface $DEVICE)
                    if [[ $is_net = "yes" ]]; then
@@ -709,6 +732,97 @@ l2of_nvme()
     OF_PATH="${OF_PATH}:${devpart}"
 }
 
+#
+# l2of_nvmf
+# Conversion routine for logical => OF path of nvme devices
+#
+l2of_nvmf()
+{
+
+    # OF path: <devspec>/nvme-of/controller@<target-wwpn>,<ctrl-id>:
+    #          nqn=<tgt-subsystem-nqn> /namespace@<namespace-id>:
+    #          <disk-label-args>
+
+    # disk: nvmeX, nvmeXnY; not nvmeXnYpZ
+    local devdisk="${DEVICE%p[0-9]*}"
+
+    # namespace id: Y in nvmeXnY, nvmeXnYpZ
+    local devnsid="${devdisk#nvme[0-9]*n}"
+    if [[ $devnsid = $devdisk ]]; then
+        devnsid='' # no namespace id
+    fi
+
+    # partition number: Z in nvmeXnYpZ
+    local devpart="${DEVICE##*p}"
+    if [[ $devpart = $DEVICE ]]; then
+        devpart='' # no partition number
+    fi
+
+    # controller name: nvmeX
+    local ctrl_name="${DEVICE%n[0-9]*}"
+
+    # Get the device-tree device specification (devspec).
+    local dir
+
+    for dir in `$FIND /sys/devices/virtual/nvme-fabrics -name "$ctrl_name"`; do
+        cd $dir
+        if [[ -f $PWD/address ]]; then
+            h_wwpn=`$CAT $PWD/address | cut -d "-" -f 5`
+            h_wwpn="${h_wwpn#0x}"
+            t_wwpn=`$CAT $PWD/address | cut -d "-" -f 3`
+            t_wwpn="${t_wwpn#0x}"
+            t_wwpn="${t_wwpn%,*}"
+            nqn=`$CAT $PWD/subsysnqn`
+            cntlid_dec=`$CAT $PWD/cntlid`
+            cntlid=`echo "obase=16; $cntlid_dec" |bc`
+            if [[ -n $h_wwpn ]]; then
+                for f in `$FIND /sys/devices -name "port_name"`; do
+                    sys_wwpn=`$CAT $f 2>/dev/null`
+                    sys_wwpn="${sys_wwpn#0x}"
+                    if [[ $h_wwpn = $sys_wwpn ]] && \
+                    [[ "$f" == *"fc_host"* ]]; then
+                        f=${f%/*}
+                        goto_dir $f "device" 0
+                        link=`get_link "device"`
+                        cd $link
+                        goto_dir $PWD "devspec"
+                        if [[ -e $PWD/devspec ]]; then
+                            OF_PATH=`$CAT $PWD/devspec`
+                            break
+                        fi
+                    fi
+                done
+            fi
+        fi
+    done
+
+    if [[ -z $OF_PATH ]]; then
+        err $ERR_NO_OFPATH
+    fi
+
+    OF_PATH="${OF_PATH}/nvme-of/controller@${t_wwpn},${cntlid}:nqn=${nqn}"
+
+    # No namespace id (nY) specified.
+    if [[ -n $devnsid ]]; then
+        res=`$FIND /sys/devices/virtual -name ${devdisk}`
+        if [[ ${#res} = 0 ]]; then
+            OF_PATH=""
+        else
+            OF_PATH="$OF_PATH/namespace@$devnsid"
+        fi
+    fi
+
+    # No partition (pZ) specified.
+    if [[ -n $devpart ]]; then
+        res=`$FIND /sys/devices/virtual -name ${devdisk}p${devpart}`
+        if [[ ${#res} = 0 ]]; then
+            OF_PATH=""
+        else
+            OF_PATH="${OF_PATH}:${devpart}"
+        fi
+    fi
+}
+
 #
 # int_to_scsilun
 # Conversion routine for SCSI HBTL LUN => SCSI LUN name
@@ -1046,6 +1160,11 @@ ofpathname_to_logical()
         DEVTYPE="nvme"
     fi
 
+    if [[ "$DEVPATH" == *"nvme-of"* ]]; then
+        DEVTYPE="nvmf"
+    fi
+
+
     # Remove any possible cdrom data from DEVICE
     if [[ ${DEVICE##*,} = "\ppc\bootinfo.txt" ||
           ${DEVICE##*,} = \ppc\bootinfo.txt ]]; then
@@ -1060,7 +1179,8 @@ ofpathname_to_logical()
     # Remove any possible partition reference
     PART=$(expr "$DEVICE" : '.*\(:[0-9]\)')
     if [[ -n $PART ]] && \
-    [[ $DEVTYPE != "nvme" ]]; then
+    [[ $DEVTYPE != "nvme" ]] && \
+    [[ $DEVTYPE != "nvmf" ]]; then
         PART=${PART:1}
         DEVICE=${DEVICE%:[0-9]}
     fi
@@ -1080,6 +1200,7 @@ ofpathname_to_logical()
         disk*         )  of2l_ide ;;
         usb           )  of2l_usb ;;
         nvme          )  of2l_nvme ;;
+        nvmf          )  of2l_nvmf ;;
     esac
 
     if [[ -z $LOGICAL_DEVNAME ]]; then
@@ -1088,7 +1209,8 @@ ofpathname_to_logical()
 
     # Add any previously stripped partition reference
     if [[ -n $PART ]] && \
-    [[ $DEVTYPE != "nvme" ]]; then
+    [[ $DEVTYPE != "nvme" ]] && \
+    [[ $DEVTYPE != "nvmf" ]]; then
         LOGICAL_DEVNAME=$LOGICAL_DEVNAME$PART
     fi
 
@@ -1689,6 +1811,87 @@ of2l_nvme()
     fi
 }
 
+# of2l_nvmf
+# Conversion routine for OF path => logical name for nvme devices
+#
+of2l_nvmf()
+{
+    # get namespace id and partition number
+    DEVICE=${DEVNAME##/*/}
+    if [[ "$DEVICE" == *"namespace"* ]]; then
+        local nsid_part=${DEVICE##*@} # <namespace-id>[:partition-number]
+        local nsid=${nsid_part%:*} # namespace id
+    fi
+    of_path_addr=`echo $DEVNAME | cut -d "/" -f 2,3`
+    ctrl_name=`echo $DEVNAME | cut -d "/" -f 5`
+    OF_WWPN=${ctrl_name%,*}
+    OF_WWPN=${OF_WWPN#*@}
+    of_cntlid=${ctrl_name%%:*}
+    of_cntlid=${of_cntlid#*,}
+    # set partition number only if ':' is present
+    case "${nsid_part}" in
+    *:*)
+        part=${nsid_part#*:}
+        ;;
+    esac
+    local dir
+
+    for dir in `$FIND /sys/devices/virtual/nvme-fabrics -name "nvme[0-9]*"`; do
+        cd $dir
+        if [[ -f $PWD/address ]]; then
+            t_wwpn=`$CAT $PWD/address | cut  -f 3 -d "-"`
+            t_wwpn="${t_wwpn#0x}"
+            t_wwpn="${t_wwpn%,*}"
+            h_wwpn=`$CAT $PWD/address | cut  -f 5 -d "-"`
+            h_wwpn="${h_wwpn#0x}"
+            cntlid_dec=`$CAT $PWD/cntlid 2>/dev/null`
+            cntlid=`echo "obase=16; $cntlid_dec" |bc`
+            if [[ $t_wwpn = $OF_WWPN ]] && \
+                [[ $cntlid == $of_cntlid ]]; then
+                for f in `$FIND /sys/devices -name "port_name"`; do
+                    sys_wwpn=`$CAT $f 2>/dev/null`
+                    sys_wwpn="${sys_wwpn#0x}"
+                    if [[ $h_wwpn = $sys_wwpn ]] && \
+                      [[ "$f" == *"fc_host"* ]]; then
+                        f=${f%/*}
+                        goto_dir $f "device" 0
+                        link=`get_link "device"`
+                        cd $link
+                        goto_dir $PWD "devspec"
+                        if [[ -e $PWD/devspec ]]; then
+                            pci_addr=`$CAT $PWD/devspec`
+                            pci_addr=${pci_addr#*/}
+                        fi
+                        if [[ $of_path_addr = $pci_addr ]]; then
+                            LOGICAL_DEVNAME="${dir##*/}"
+                            break
+                        fi
+                    fi
+                done
+            fi
+        fi
+    done
+    if [[ -n $LOGICAL_DEVNAME ]] && \
+       [[ -n $nsid ]]; then
+        res=`$FIND /sys/devices/virtual -name ${LOGICAL_DEVNAME}n${nsid}`
+        if [[ ${#res} = 0 ]]; then
+            LOGICAL_DEVNAME=''
+        else
+            LOGICAL_DEVNAME="${LOGICAL_DEVNAME}n${nsid}"
+        fi
+    fi
+
+    if [[ -n $LOGICAL_DEVNAME ]] && \
+       [[ -n $part ]]; then
+        res=`$FIND /sys/devices/virtual -name ${LOGICAL_DEVNAME}p${part}`
+        if [[ ${#res} = 0 ]]; then
+            LOGICAL_DEVNAME=''
+        else
+            LOGICAL_DEVNAME="${LOGICAL_DEVNAME}p${part}"
+        fi
+    fi
+}
+
 #
 # Main
 #
-- 
2.34.1

Reply via email to