Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion usr/lib/linuxmint/mintreport/bios.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import xapp.util
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from common import read_dmi, read_efi, clean_brand
from common import read_dmi, read_efi, clean_brand, read_virt

_ = xapp.util.l10n("mintreport")

Expand Down Expand Up @@ -55,6 +55,13 @@ def load(self):
else:
infos_bios.append([_('Secure Boot'), _("Disabled")])

# Virtualization
virt = read_virt()
virt_value = _('Disabled')
if virt:
virt_value = _('Enabled (%s)') % virt
infos_bios.append([_('Virtualization'), virt_value])

infos_motherboard = []
infos_motherboard.append([_('Brand'), clean_brand(read_dmi('board_vendor'))])
infos_motherboard.append([_('Name'), read_dmi('board_name')])
Expand Down
13 changes: 13 additions & 0 deletions usr/lib/linuxmint/mintreport/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,16 @@ def read_dmi(field):
"Western Digital": "WD",
"Xilinx Corporation": "Xilinx",
}

def read_virt():
"""Reads '/proc/cpuinfo' to determine whether virtualization is supported."""
with open("/proc/cpuinfo", "r") as cpuinfo:
for line in cpuinfo:
if line[:5] == "flags":
if " vmx " in line:
return "VT-x"
elif " svm " in line:
return "AMD-V"
else:
return None