SWDEV-461038 - Enabled Passthrough as BM for CLI Commands

Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I1ae6a065f10ce580b45b79c0a8588853f5f304f7
Este cometimento está contido em:
Maisam Arif criou e Maisam Arif cometeu 2024-05-30 15:47:14 -04:00
1 ascendente b39b39ef3c
cometimento 80eeff3dd4
2 ficheiros modificados
+17 -1

Não existem ficheiros que correspondam à sua pesquisa

+13
Ver ficheiro
@@ -49,6 +49,7 @@ class AMDSMIHelpers():
self._is_hypervisor = False
self._is_virtual_os = False
self._is_baremetal = False
self._is_passthrough = False
self._is_linux = False
self._is_windows = False
@@ -63,6 +64,14 @@ class AMDSMIHelpers():
else:
self._is_virtual_os = True
# Check for passthrough system filtering by device id
output = run(["lspci", "-nn"], stdout=PIPE, stderr=STDOUT, encoding="UTF-8").stdout
passthrough_device_ids = ["7460", "73c8", "74a0", "74a1", "74a2"]
if any(device_id in output for device_id in passthrough_device_ids):
self._is_baremetal = True
self._is_virtual_os = False
self._is_passthrough = True
def os_info(self, string_format=True):
"""Return operating_system and type information ex. (Linux, Baremetal)
@@ -89,6 +98,10 @@ class AMDSMIHelpers():
else:
operating_system_type = "Unknown"
# Passthrough Override
if self._is_passthrough:
operating_system_type = "Guest (Passthrough)"
if string_format:
return f"{operating_system} {operating_system_type}"
else: