]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Fix detection of the Citrix Xen Server hypervisor.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 26 Nov 2010 12:48:11 +0000 (13:48 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 26 Nov 2010 12:48:11 +0000 (13:48 +0100)
fireinfo/hypervisor.py

index 4b8f873da942234371acefb880387c4c6e40172a..97eb985f55a26c881b2ca0b053afc9fc04208fab 100644 (file)
@@ -25,11 +25,17 @@ class Hypervisor(object):
                if not self.virtual:
                        return None
 
-               # If the script already returned a hypervisor, we return the name.
-               if self.__info["hypervisor"]:
+               # Some of the hypervisors can be detected in a right way.
+               # We can return them at this place.
+               if self.__info["hypervisor"] in ("Xen", "VMWare", "KVM"):
                        return self.__info["hypervisor"]
 
-               # XXX fill in some code to detect hypervisors, that do
+               # Citrix Xen says it is Microsoft Hv.
+               if self.__info["hypervisor"] == "Microsoft" and \
+                               self.system.bios_vendor == "Xen":
+                       return "Xen"
+
+               # XXX fill in some code to detect more hypervisors, that do
                # not say their name. 
 
                return "unknown"