From a29e8ba0eee916dc3d0051d7dd3e6d4680c8ee2c Mon Sep 17 00:00:00 2001 From: Filip Strajnar Date: Sat, 26 Oct 2024 19:13:59 +0200 Subject: [PATCH] Added method that checks if device is VGA. --- src/pci_passthrough_assist/pci_device.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pci_passthrough_assist/pci_device.py b/src/pci_passthrough_assist/pci_device.py index 2ea16d4..4c24123 100644 --- a/src/pci_passthrough_assist/pci_device.py +++ b/src/pci_passthrough_assist/pci_device.py @@ -1,4 +1,5 @@ from pci_passthrough_assist.pci import driver_of_pci_device +from os.path import exists class PciDevice: @@ -8,3 +9,9 @@ class PciDevice: def driver_name(self) -> str: return driver_of_pci_device(self.device_id) + + def is_vga(self) -> bool: + return exists(f"/sys/bus/pci/devices/{self.device_id}/boot_vga") + + def __str__(self) -> str: + return f"{self.device_id} driver: {self.driver_name()} VGA: {self.is_vga()}" \ No newline at end of file