]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Read PCI class from sysfs class file instead of config space.
authorThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Tue, 24 Dec 2013 18:07:27 +0000 (16:07 -0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Jan 2014 16:33:59 +0000 (17:33 +0100)
commit9a3d7a47788510872587c052716b43806fa36a6f
tree424d63a29b6482916b1ce751b91a6c5ff82289ea
parenta18b8aada620d6f67caa60613cf2364e5098e9f4
Read PCI class from sysfs class file instead of config space.

When determining if a device is behind a PCI bridge, the PCI device
class is checked by reading the config space. However, there are some
devices which have the wrong class on the config space, but the class is
initialized by Linux correctly as a PCI BRIDGE. This class can be read
by the sysfs file '/sys/bus/pci/devices/xxxx:xx:xx.x/class'.

One example of such bridge is IBM PCI Bridge 1014:03b9, which is
identified as a Host Bridge when reading the config space.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
src/util/virpci.c
tests/virpcimock.c
tests/virpcitest.c
tests/virpcitestdata/0001:00:00.0.config [new file with mode: 0644]
tests/virpcitestdata/0001:01:00.0.config [new file with mode: 0644]
tests/virpcitestdata/0001:01:00.1.config [new file with mode: 0644]
tests/virpcitestdata/0005:80:00.0.config [new file with mode: 0644]
tests/virpcitestdata/0005:90:01.0.config [new file with mode: 0644]
tests/virpcitestdata/0005:90:01.1.config [new file with mode: 0644]
tests/virpcitestdata/0005:90:01.2.config [new file with mode: 0644]