From: Michael Tremer Date: Fri, 26 Nov 2010 12:48:11 +0000 (+0100) Subject: Fix detection of the Citrix Xen Server hypervisor. X-Git-Tag: v0.3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0d2bae3ea3612ef63b2af0f9075198d49f931b6;p=oddments%2Ffireinfo.git Fix detection of the Citrix Xen Server hypervisor. --- diff --git a/fireinfo/hypervisor.py b/fireinfo/hypervisor.py index 4b8f873..97eb985 100644 --- a/fireinfo/hypervisor.py +++ b/fireinfo/hypervisor.py @@ -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"