Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Joji Mekkattuparamban <[email protected]>
  • Loading branch information
jojimt committed Jun 27, 2024
1 parent 4d1581e commit 7a5f20e
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions assets/state-vfio-manager/0400_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,24 @@ data:
local gpu=$1
device_class_file=$(readlink -f "/sys/bus/pci/devices/$gpu/class")
device_class=$(cat "$device_class_file")
if [ "$device_class" == "0x030000" ]; then
if ls "/sys/bus/pci/devices/$gpu" | grep consumer >& /dev/null; then
aux_dev=$(ls "/sys/bus/pci/devices/$gpu" | grep consumer | awk -Fconsumer:pci: '{print $2}')
if [ "$device_class" == "" ]; then
echo "NONE"
return
fi
if [ "$device_class" != "0x030000" ]; then
echo "NONE"
return
fi
if ls "/sys/bus/pci/devices/$aux_dev/" >& /dev/null; then
echo "$aux_dev"
return
fi
if ls "/sys/bus/pci/devices/$gpu" | grep consumer >& /dev/null; then
aux_dev=$(ls "/sys/bus/pci/devices/$gpu" | grep consumer | awk -Fconsumer:pci: '{print $2}')
if [ "$aux_dev" == "" ]; then
echo "NONE"
return
fi
if ls "/sys/bus/pci/devices/$aux_dev/" >& /dev/null; then
echo "$aux_dev"
return
fi
fi
echo "NONE"
}
Expand Down

0 comments on commit 7a5f20e

Please sign in to comment.