Added method that checks if device is VGA.

This commit is contained in:
Filip Strajnar 2024-10-26 19:13:59 +02:00
parent 3e92aab2e7
commit a29e8ba0ee

View file

@ -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()}"