This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
device: Generalize PCI paths to any number of bridges
Currently pciPathToSysfsImpl, which translates PCI paths into sysfs paths accepts only pci paths with exactly 2 components; which represents PCI devices separated from the root bus by exactly one PCI to PCI bridge (which could be a virtual P2P bridge, such as a PCI-E root port). There are cases we might reasonably want to support which have devices either plugged directly into the root bus (zero bridges), or under multiple layers of P2P bridge (a PCI-E switch would require at least 2 layers). So, generalize pciPathToSysfs to support any number of components in the PCI path. We need to adjust some tests to match, not only because of the intended change in behaviour, but also because the new version probes sysfs a bit differently, so we need to mock things to match. fixes #854 Signed-off-by: David Gibson <[email protected]>
- Loading branch information
Showing
3 changed files
with
69 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters