From: Michael Tremer Date: Tue, 18 Jan 2011 18:52:28 +0000 (+0100) Subject: Add support for Microsoft Hyper-V and Virtual PC. X-Git-Tag: v2.0.3~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=a79b7395c91ef04da0bfc9a7e6ade7094ad9cd48;p=oddments%2Ffireinfo.git Add support for Microsoft Hyper-V and Virtual PC. --- diff --git a/fireinfo/hypervisor.py b/fireinfo/hypervisor.py index 76cd3a2..9286bd4 100644 --- a/fireinfo/hypervisor.py +++ b/fireinfo/hypervisor.py @@ -67,6 +67,10 @@ class Hypervisor(object): elif self.__is_hypervisor_qemu(): return "Qemu" + # Check for Microsoft. + elif self.__is_hypervisor_microsoft(): + return "Microsoft" + return "unknown" @property @@ -96,7 +100,8 @@ class Hypervisor(object): "hypervisor" in self.system.cpu.flags or \ self.__is_hypervisor_virtualbox() or \ self.__is_hypervisor_vmware() or \ - self.__is_hypervisor_qemu() + self.__is_hypervisor_qemu() or \ + self.__is_hypervisor_microsoft() def __is_hypervisor_virtualbox(self): """ @@ -123,6 +128,12 @@ class Hypervisor(object): """ return self.system.bios_vendor == "Bochs" + def __is_hypervisor_microsoft(self): + """ + Check for Microsoft hypervisor. + """ + return "Microsoft" in self.system.vendor + if __name__ == "__main__": h = Hypervisor()