]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Get missing hypervisors from System.bios_vendor.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Nov 2010 19:41:27 +0000 (20:41 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Nov 2010 19:41:27 +0000 (20:41 +0100)
Closes #99.
Closes #102.

fireinfo/hypervisor.py

index 328fd26927799da505771514fb5342fdcf28a8ff..b659d6e3096ee24fc05be14410af04eadc6960ff 100644 (file)
@@ -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"