path: root/drivers/net/virtio/virtio_pci.c
diff options
authorJan Viktorin <>2016-06-13 17:07:44 +0200
committerThomas Monjalon <>2016-06-13 21:08:48 +0200
commit53c3c30c1120a641ae61822cad85ff0ec3a2158b (patch)
tree435596b3c42266e80c5c0343c72562bf8a94bbe0 /drivers/net/virtio/virtio_pci.c
parentceabf73721bf77592a5bc47ac8e66e6bd346a2b2 (diff)
pci: allow to override sysfs path
The SYSFS_PCI_DEVICES is a constant that makes the PCI testing difficult as it points to an absolute path. We remove using this constant and introducing a function pci_get_sysfs_path that gives the same value. However, the user can pass a SYSFS_PCI_DEVICES env variable to override the path. It is now possible to create a fake sysfs hierarchy for testing. Signed-off-by: Jan Viktorin <>
Diffstat (limited to 'drivers/net/virtio/virtio_pci.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
index 9cdca06..845141b 100644
--- a/drivers/net/virtio/virtio_pci.c
+++ b/drivers/net/virtio/virtio_pci.c
@@ -179,7 +179,7 @@ legacy_virtio_has_msix(const struct rte_pci_addr *loc)
char dirname[PATH_MAX];
snprintf(dirname, sizeof(dirname),
- SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/msi_irqs",
+ "%s/" PCI_PRI_FMT "/msi_irqs", pci_get_sysfs_path(),
loc->domain, loc->bus, loc->devid, loc->function);
d = opendir(dirname);