Commit f2beeb95 authored by Kirill Smelkov's avatar Kirill Smelkov

X neotest: info-local: Fix NIC display for virtio devices

For virtio NICs /sys/class/net/<NIC>/device lead to $pcidev/virtioX, not just $pcidev, e.g.:

	$ realpath /sys/class/net/ens3/device
	/sys/devices/pci0000:00/0000:00:03.0/virtio0

and we were extracting virtio0 instead of 0000:00:03.0 as PCI device identifier.

-> Fix it by recognizing and stripping /virtioX suffix.
parent 4942c900
...@@ -741,6 +741,8 @@ system_info() { ...@@ -741,6 +741,8 @@ system_info() {
nicname=`basename $nic` # /sys/class/net/eth0 -> eth0 nicname=`basename $nic` # /sys/class/net/eth0 -> eth0
echo -n "nic/$nicname: " echo -n "nic/$nicname: "
nicdev=`realpath $nic/device` # /sys/class/net/eth0 -> /sys/devices/pci0000:00/0000:00:1f.6 nicdev=`realpath $nic/device` # /sys/class/net/eth0 -> /sys/devices/pci0000:00/0000:00:1f.6
# for virtio NICs $nic/device lead to $pcidev/virtioX, not just $pcidev
nicdev=`echo $nicdev | sed -s 's\\/virtio.$\\\\'`
case "$nicdev" in case "$nicdev" in
*usb*) *usb*)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment