]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
CI: adjust resolving network interface into PCI device
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Mon, 7 Apr 2025 12:31:09 +0000 (14:31 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 Apr 2025 18:17:38 +0000 (19:17 +0100)
Change how PCI device lookup is done to handle also USB devices, in
which case get the USB controller. Instead of taking basename of the
'device' symlink, resolve the full path (example:
/sys/devices/pci0000:00/0000:00:09.0/usb4/4-7/4-7:1.0) and take the
first part after pci0000:00. Theoretically it could be a bridge, but VM
has flat PCI topology.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
automation/scripts/qubes-x86-64.sh

index 2b04d281d74bb6ba0dd5c88a7e9acf0575889781..a964ac4b7a4e2810a433d969e92fed4ee8944b04 100755 (executable)
@@ -110,7 +110,8 @@ timeout 30s udhcpc -i \"\$interface\"
 pingip=\$(ip -o -4 r show default|cut -f 3 -d ' ')
 ping -c 10 \"\$pingip\"
 echo domU started
-pcidevice=\$(basename \$(readlink /sys/class/net/\$interface/device))
+pcidevice=\$(realpath /sys/class/net/\$interface/device |
+             sed 's#.*pci0000:00/\\([^/]*\\).*#\\1#')
 lspci -vs \$pcidevice
 "
         if [ -n "$PCIDEV_INTR" ]; then