From 111caa2a5e08579597b8e24ef1c2522b27876769 Mon Sep 17 00:00:00 2001 From: Filip Strajnar Date: Sat, 26 Oct 2024 18:33:45 +0200 Subject: [PATCH] Added convenience functions for PCI device and driver IDs. --- src/pci_passthrough_assist/pci.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/pci_passthrough_assist/pci.py diff --git a/src/pci_passthrough_assist/pci.py b/src/pci_passthrough_assist/pci.py new file mode 100644 index 0000000..68b8780 --- /dev/null +++ b/src/pci_passthrough_assist/pci.py @@ -0,0 +1,9 @@ +from os import listdir + + +def all_pci_device_ids() -> list[str]: + return listdir("/sys/bus/pci/devices") + + +def all_pci_driver_ids() -> list[str]: + return listdir("/sys/bus/pci/drivers")