From: Michael Tremer Date: Sun, 28 Nov 2010 19:41:27 +0000 (+0100) Subject: Get missing hypervisors from System.bios_vendor. X-Git-Tag: v0.3~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9fc4e8923b0f003c7140eae5c1343948d864657;p=oddments%2Ffireinfo.git Get missing hypervisors from System.bios_vendor. Closes #99. Closes #102. --- diff --git a/fireinfo/hypervisor.py b/fireinfo/hypervisor.py index 328fd26..b659d6e 100644 --- a/fireinfo/hypervisor.py +++ b/fireinfo/hypervisor.py @@ -35,8 +35,14 @@ class Hypervisor(object): self.system.bios_vendor == "Xen": return "Xen" - # XXX fill in some code to detect more hypervisors, that do - # not say their name. + if not self.__info["hypervisor"]: + # On VMWare systems, the bios vendor string contains "VMWare". + if "VMWare" in self.system.bios_vendor: + return "VMWare" + + # VirtualBox got "innotek GmbH" as bios vendor. + elif self.system.bios_vendor == "innotek GmbH": + return "VirtualBox" return "unknown"